### Build and Install SSMOS Plugin Source: https://context7.com/whoneedspacee/ssmos/llms.txt Steps to clone the SSMOS repository, build the plugin using Maven, and set up the server. Requires Java 8. The compiled JAR is placed in the plugins directory. ```bash # Clone the repository git clone https://github.com/Whoneedspacee/SSMOS.git cd SSMOS # Build with Maven (requires Java 8) mvn clean install # The compiled JAR will be automatically copied to: # ssmos-template-server/v1.1/plugins/SSMOS-1.0.jar # Start the server cd ssmos-template-server/v1.1 ./start.bat # or start.sh on Linux # Expected output: # [Server] INFO Loading SSMOS v1 # [SSMOS] INFO Initializing game servers... # [SSMOS] INFO Created 9 game servers with various modes ``` -------------------------------- ### Create Custom Kit in Java for SSMOS Source: https://context7.com/whoneedspacee/ssmos/llms.txt Example of creating a custom playable character (kit) by extending the `Kit` base class in Java. This involves defining stats, assigning abilities, and setting up armor and hotbar items. ```java package xyz.whoneedspacee.ssmos.kits.custom; import xyz.whoneedspacee.ssmos.kits.Kit; import xyz.whoneedspacee.ssmos.abilities.original.Blink; import xyz.whoneedspacee.ssmos.abilities.original.Inferno; import xyz.whoneedspacee.ssmos.attributes.Regeneration; import xyz.whoneedspacee.ssmos.attributes.doublejumps.GenericDoubleJump; import org.bukkit.Material; import org.bukkit.Sound; import org.bukkit.entity.EntityType; import org.bukkit.inventory.ItemStack; public class KitMyCustomMob extends Kit { public KitMyCustomMob() { super(); this.name = "Custom Mob"; this.damage = 8; // Base melee damage this.armor = 5; // Damage reduction this.knockback = 1.0; // Knockback multiplier this.regeneration = 0.5; // HP per second this.menuItem = Material.DIAMOND; // Icon in kit selector this.podium_mob_type = EntityType.ZOMBIE; // Lobby display } @Override public void initializeKit() { // Set armor (0=boots, 1=leggings, 2=chest, 3=helmet) setArmorSlot(Material.DIAMOND_BOOTS, 0); setArmorSlot(Material.DIAMOND_LEGGINGS, 1); setArmorSlot(Material.DIAMOND_CHESTPLATE, 2); setArmorSlot(Material.DIAMOND_HELMET, 3); // Assign abilities to hotbar slots (0-8) setAbility(new Blink(), 1); // Slot 1: Teleport ability setAbility(new Inferno(), 2); // Slot 2: Fire attack // Add passive attributes addAttribute(new Regeneration(regeneration)); addAttribute(new GenericDoubleJump(1.2, 1.0, Sound.BAT_TAKEOFF)); } @Override public void setPreviewHotbar() { // Items shown in lobby before game starts setItem(new ItemStack(Material.DIAMOND_SWORD), 0); setItem(new ItemStack(Material.BLAZE_ROD), 1); setItem(new ItemStack(Material.FIREBALL), 2); } @Override public void setGameHotbar() { // Items shown during active gameplay setItem(new ItemStack(Material.DIAMOND_SWORD), 0); setItem(new ItemStack(Material.BLAZE_ROD), 1); setItem(new ItemStack(Material.FIREBALL), 2); } } ``` -------------------------------- ### Manage Player Kits (Java) Source: https://context7.com/whoneedspacee/ssmos/llms.txt Equip, manage, and inspect player kits during gameplay. This system allows players to be assigned kits with specific abilities, stats, and passive attributes. Code examples demonstrate equipping, un-equipping, checking kit details, accessing individual abilities, and opening the kit selection menu. ```java import xyz.whoneedspacee.ssmos.managers.KitManager; import xyz.whoneedspacee.ssmos.kits.Kit; import xyz.whoneedspacee.ssmos.kits.original.KitEnderman; import xyz.whoneedspacee.ssmos.kits.original.KitBlaze; import org.bukkit.entity.Player; Player player = Bukkit.getPlayer("Steve"); // Equip a kit to a player Kit endermanKit = new KitEnderman(); KitManager.equipPlayer(player, endermanKit); // Expected: Player receives Enderman armor, abilities (BlockToss, Blink), // and passive attributes (teleport on water, double jump) // Get player's current kit Kit currentKit = KitManager.getPlayerKit(player); if (currentKit != null) { System.out.println(player.getName() + " is using: " + currentKit.getName()); // Check kit stats System.out.println("Melee damage: " + currentKit.getMelee()); System.out.println("Armor: " + currentKit.getArmor()); System.out.println("Knockback multiplier: " + currentKit.getKnockback()); } // Access specific ability Ability blinkAbility = currentKit.getAbilityInSlot(1); // Slot 1 if (blinkAbility != null) { blinkAbility.checkAndActivate(); // Manually trigger ability } // Remove kit from player KitManager.unequipPlayer(player); // Expected: All abilities removed, attributes unregistered, // inventory cleared, disguise removed // Open kit selection menu KitManager.openKitMenu(player); // Expected: GUI opens showing all available kits for current gamemode ``` -------------------------------- ### Create Custom Player Ability (Java) Source: https://context7.com/whoneedspacee/ssmos/llms.txt Implement custom player abilities that can be triggered by specific player actions. This example shows a 'Super Jump' ability that launches the player upwards and applies effects. It utilizes event listeners for right-clicks and custom utility classes for velocity manipulation. ```java package xyz.whoneedspacee.ssmos.abilities.custom; import xyz.whoneedspacee.ssmos.abilities.Ability; import xyz.whoneedspacee.ssmos.managers.ownerevents.OwnerRightClickEvent; import xyz.whoneedspacee.ssmos.utilities.VelocityUtil; import org.bukkit.ChatColor; import org.bukkit.Sound; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.util.Vector; public class SuperJump extends Ability implements OwnerRightClickEvent { public SuperJump() { super(); this.name = "Super Jump"; this.usage = AbilityUsage.RIGHT_CLICK; this.cooldownTime = 10; // Seconds until ability can be used again this.expUsed = 0.25f; // Experience points consumed per use this.description = new String[] { ChatColor.RESET + "Launch yourself high into the air", ChatColor.RESET + "and deal damage to enemies you land on.", ChatColor.RESET + "", ChatColor.RESET + "Cooldown: 10 seconds" }; } @Override public void onOwnerRightClick(PlayerInteractEvent e) { checkAndActivate(); // Handles cooldown and XP checks automatically } @Override public void activate() { // Get player's current velocity and add vertical boost Vector velocity = owner.getLocation().getDirection(); velocity.setY(2.5); // Strong upward component VelocityUtil.setVelocity(owner, velocity, 1.5, false, 0, 0, 10, true); // Play effects owner.playSound(owner.getLocation(), Sound.ENDERDRAGON_WINGS, 1.5f, 1.2f); owner.getWorld().playEffect(owner.getLocation(), Effect.ENDER_SIGNAL, 0); // Reset fall damage so landing doesn't hurt the player owner.setFallDistance(0); } } ``` -------------------------------- ### Handle Game State Changes in Java Source: https://context7.com/whoneedspacee/ssmos/llms.txt Listens for GameStateChangeEvent to manage different stages of the game, such as waiting for players, voting, starting, playing, and ending. It uses a switch statement based on the new game state to perform specific actions and print relevant information to the console. Dependencies include Bukkit API and custom SSMOS classes like GameState and SmashServer. ```java import xyz.whoneedspacee.ssmos.managers.gamestate.GameState; import xyz.whoneedspacee.ssmos.events.GameStateChangeEvent; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; public class GameFlowListener implements Listener { @EventHandler public void onStateChange(GameStateChangeEvent e) { SmashServer server = e.getServer(); short oldState = e.getOldState(); short newState = e.getNewState(); switch(newState) { case GameState.LOBBY_WAITING: // Waiting for players to join (< minimum required) System.out.println("Need " + (server.getCurrentGamemode().getPlayersToStart() - server.getActivePlayerCount()) + " more players"); break; case GameState.LOBBY_VOTING: // 15 second countdown, players vote for maps System.out.println("Map voting started"); server.openVotingMenu(somePlayer); break; case GameState.LOBBY_STARTING: // 15 second countdown, players select kits System.out.println("Game starting soon, choose your kit!"); // Players can click podium mobs to select kits break; case GameState.GAME_STARTING: // 10 second countdown, players frozen at spawn System.out.println("Game begins in " + server.getTimeLeft() + " seconds"); // Displays gamemode instructions as titles break; case GameState.GAME_PLAYING: // Active combat, abilities enabled System.out.println("Fight! " + server.getLives(player) + " lives"); for (Player p : server.players) { Kit kit = KitManager.getPlayerKit(p); if (kit != null && kit.isActive()) { // Abilities are now functional } } break; case GameState.GAME_ENDING: // 10 second celebration with fireworks System.out.println("Winners: " + server.getCurrentGamemode().getFirstPlaceString()); // Automatically transitions to LOBBY_WAITING break; } } } // Check state manually if (GameState.isStarting(server.getState())) { // Either LOBBY_STARTING or GAME_STARTING } if (GameState.isPlaying(server.getState())) { // GAME_PLAYING - abilities work, damage enabled } ``` -------------------------------- ### Game Control and Debugging Commands (Bash) Source: https://context7.com/whoneedspacee/ssmos/llms.txt A collection of bash commands for managing kits, controlling game state, modifying player status, managing servers, and debugging the game. These commands are executed via the in-game chat interface. ```bash # Kit management /kit Enderman # Expected: Equips Enderman kit with abilities Block Toss and Blink /randomkit # Expected: Assigns random kit from available pool /setkit Steve Blaze # Expected: Forces Steve to use Blaze kit # Game control /start # Expected: Skips lobby countdown, starts game immediately /stop # Expected: Ends current game, returns players to lobby /vote # Expected: Opens map voting GUI # Player state /spectate # Expected: Toggles spectator mode (won't participate in next game) /setlives Notch 5 # Expected: Sets Notch to have 5 lives in current game /setplaying # Expected: Force-activates kit abilities even in lobby # Server management /server # Expected: Opens server browser showing all game instances /makeserver SoloGamemode # Expected: Creates new game server with specified mode /hub # Expected: Teleports player back to main lobby world # Debugging /damagelog # Expected: Shows last 15 seconds of damage taken with sources /printentities # Expected: Lists all entities in current world with types /ping ``` -------------------------------- ### Manage SmashServer Game Flow (Java) Source: https://context7.com/whoneedspacee/ssmos/llms.txt Control the lifecycle and state transitions of a Smash Server instance. This includes creating, managing player counts, handling player deaths, opening voting menus, stopping games, and deleting servers. It interacts with `GameManager` and `SmashServer` classes. ```java import xyz.whoneedspacee.ssmos.managers.GameManager; import xyz.whoneedspacee.ssmos.managers.smashserver.SmashServer; import xyz.whoneedspacee.ssmos.managers.gamemodes.SoloGamemode; import xyz.whoneedspacee.ssmos.managers.gamemodes.TeamsGamemode; import org.bukkit.entity.Player; // Create a new game server instance SmashServer server = GameManager.createSmashServer(new SoloGamemode()); // Check server state (returns GameState constants) if (server.isPlaying()) { System.out.println("Game in progress with " + server.getActivePlayerCount() + " players"); } // Players automatically join when they enter the lobby world Player player = Bukkit.getPlayer("Notch"); SmashServer playerServer = GameManager.getPlayerServer(player); if (playerServer != null) { int lives = playerServer.getLives(player); System.out.println(player.getName() + " has " + lives + " lives remaining"); } // Manual death trigger (called by damage system) server.death(player); // Expected: Player respawns after 4 seconds if lives remain, // otherwise becomes spectator // Open voting menu for map selection server.openVotingMenu(player); // Stop the current game server.stopGame(); // Expected: Transitions to GAME_ENDING, then back to LOBBY_WAITING // Remove server entirely GameManager.deleteSmashServer(server); ``` -------------------------------- ### Apply Custom Damage and Knockback (Java) Source: https://context7.com/whoneedspacee/ssmos/llms.txt Applies custom damage to a target player, including knockback effects, armor calculation, and team checks. It utilizes the SmashDamageEvent to handle damage application and checks for damage validity using DamageUtil. ```java import xyz.whoneedspacee.ssmos.events.SmashDamageEvent; import xyz.whoneedspacee.ssmos.utilities.DamageUtil; import xyz.whoneedspacee.ssmos.managers.DamageManager; import org.bukkit.entity.Player; import org.bukkit.event.entity.EntityDamageEvent.DamageCause; import org.bukkit.util.Vector; Player attacker = Bukkit.getPlayer("Attacker"); Player target = Bukkit.getPlayer("Target"); // Check if damage is allowed (handles invincibility, teams, game state) if (DamageUtil.canDamage(target, attacker)) { // Create damage event SmashDamageEvent damageEvent = new SmashDamageEvent(target, attacker, 10.0); damageEvent.setDamageCause(DamageCause.ENTITY_ATTACK); damageEvent.setDamagerName(attacker.getName()); damageEvent.setReason("Melee Attack"); // Configure knockback Vector knockbackDir = target.getLocation().subtract(attacker.getLocation()).toVector(); knockbackDir.normalize(); knockbackDir.setY(0.5); // Vertical component damageEvent.setKnockback(knockbackDir, 1.5); // Base multiplier // Optional modifiers damageEvent.multiplyKnockback(1.2); // Increase by 20% damageEvent.setIgnoreArmor(false); // Respect armor stat damageEvent.setIgnoreDamageDelay(false); // Use hit delay // Apply damage damageEvent.callEvent(); // Expected: Armor reduction applied, knockback applied, // death triggered if HP drops to 0 } // Get damage history for death messages SmashDamageEvent lastDamage = DamageManager.getLastDamageEvent(target); System.out.println(target.getName() + " last damaged by " + lastDamage.getDamagerName()); // Border/void kill (instant death with special effects) DamageUtil.borderKill(target, true); // true = lightning effect // Expected: Player instantly dies, teleports to spawn, loses 1 life ``` -------------------------------- ### Implement Reflective Armor Attribute (Java) Source: https://context7.com/whoneedspacee/ssmos/llms.txt Implements a 'Reflective Armor' attribute that reflects 30% of incoming damage back to the attacker and applies a slowness effect. This attribute also handles cooldowns and is designed to be added to a player's kit. ```java import xyz.whoneedspacee.ssmos.attributes.Attribute; import xyz.whoneedspacee.ssmos.managers.ownerevents.OwnerHitByEvent; import xyz.whoneedspacee.ssmos.kits.Kit; import org.bukkit.ChatColor; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; public class ReflectiveArmor extends Attribute implements OwnerHitByEvent { public ReflectiveArmor() { super(); this.name = "Reflective Armor"; this.usage = AbilityUsage.PASSIVE; this.cooldownTime = 5; this.description = new String[] { ChatColor.RESET + "When hit, reflect 30% damage back", ChatColor.RESET + "to the attacker and slow them.", ChatColor.RESET + "", ChatColor.RESET + "Cooldown: 5 seconds" }; } @Override public void onOwnerHitBy(EntityDamageByEntityEvent e) { if (!check()) return; // Check cooldown and kit state LivingEntity attacker = (LivingEntity) e.getDamager(); double reflectedDamage = e.getDamage() * 0.3; // Create new damage event for reflection SmashDamageEvent reflect = new SmashDamageEvent(attacker, owner, reflectedDamage); reflect.setDamagerName(owner.getName() + "'s Armor"); reflect.setReason("Reflection"); reflect.multiplyKnockback(0.5); // Reduced knockback reflect.callEvent(); // Apply slowness to attacker attacker.addPotionEffect(new PotionEffect( PotionEffectType.SLOW, 60, 1 // 3 seconds, level 2 )); applyCooldown(); } @Override public void activate() { // Not used for passive abilities } } // Add to kit Kit kit = new KitIronGolem(); kit.addAttribute(new ReflectiveArmor()); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.