snipeyzen
📎 1 file 2,832 chars
📄
stasis-chamber-rod-plugin-prompt.txt
txt 55 lines
▶
Create a complete Minecraft Spigot/Paper plugin (Java) with the following exact requirements:

**Plugin Name:** StasisChamberRod

**Commands:**

1. `/pearlrod  `
   - Gives the specified player the Stasis Chamber Rod.
   - `` is the number of rods to give (default to 1 if not specified).
   - Permission: `stasisrod.give` (default: OP only)
   - Success message to the giver: `"§aGave §e Stasis Chamber Rod(s) §ato §e!"`
   - Message to the receiver: `"§aYou received §e Stasis Chamber Rod(s)!"`

2. `/stasis location   `
   - Sets the player's personal stasis location to the given coordinates in their current world.
   - Permission: `stasisrod.setlocation` (default: true for all players)
   - Success message: `"§aStasis location set to §eX: Y: Z:§a in this world!"`
   - If coordinates are invalid, send an error message.

**Stasis Chamber Rod Item:**
- Custom item name: `§bStasis Chamber Rod`
- Custom lore:
  - `§7Right-click to teleport to your stasis location`
  - `§7Infinite uses • Never breaks`
- Material: `BLAZE_ROD` (or another suitable rod-like item)
- The rod must be completely unbreakable and have infinite uses.
- Only works when the player is holding it and right-clicks (air or block).

**Rod Behavior (on right-click):**
- Teleport the player to their saved stasis location in the same world.
- Play the ender pearl landing sound (`ENTITY_ENDER_PEARL_THROW` or preferably the landing sound `ENTITY_ENDERMAN_TELEPORT` / ender pearl impact sound) at the destination.
- If the player has no stasis location set, send: `"§cYou haven't set a stasis location yet! Use /stasis location   "`
- If the stasis location is in a different world, either deny it or teleport only if same world (prefer same-world only for simplicity).
- Add a short cooldown (e.g. 3 seconds) to prevent spam, with a message if on cooldown.

**Data Storage:**
- Store each player's stasis location (world + x, y, z) persistently (use a simple YAML file or player data).
- Locations must survive server restarts.

**Permissions:**
- `stasisrod.give` → Give rods to players (default: op)
- `stasisrod.setlocation` → Set own stasis location (default: true)
- `stasisrod.use` → Ability to use the rod (default: true)

**Technical Requirements:**
- Compatible with Minecraft 1.20 – 1.21 (Paper/Spigot recommended)
- Use PersistentDataContainer or similar to mark the custom rod so it can be identified even if renamed
- Clean, well-commented code
- Proper null checks and error handling
- Include full `plugin.yml`
- Include main class + command classes + listener for the rod right-click
- Ready to compile (Maven or Gradle structure preferred)

Please provide the complete source code (all classes + plugin.yml) so I can put it directly into a project and build the jar.
Kodari AI
KodariSep 21 at 10:49 am 1
StasisChamberRod
A Minecraft Spigot/Paper plugin that adds a custom Stasis Chamber Rod item. Players receive the rod via /pearlrod command, set personal teleport locations with /stasis location, and right-click the rod to teleport back to their saved coordinates in the same world. Features persistent YAML data storage, 3-second cooldown, enderman teleport sound effects, unbreakable infinite-use item marked with PersistentDataContainer, and full permission system including stasisrod.give, stasisrod.setlocation, and stasisrod.use.
  1. Create the Gradle project and plugin metadata.

  2. Add persistent stasis-location storage and rod item identification.

  3. Add /pearlrod and /stasis location command handlers.

  4. Add the right-click listener, cooldown handling, and plugin bootstrap.

Created the complete StasisChamberRod plugin project with:

  • Gradle build configuration targeting Java 17 and Spigot API 1.21.1

  • plugin.yml with commands and permissions

  • /pearlrod <player> [count]

  • /stasis location <x> <y> <z>

  • Persistent YAML-based stasis location storage

  • PersistentDataContainer rod identification

  • Infinite-use, unbreakable Blaze Rod item

  • Same-world teleportation

  • Enderman teleport sound

  • Three-second cooldown

  • Permission checks and validation

  • Main plugin class, command classes, item handler, data store, and event listener

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
10 403
src/main/java/com/kodari/stasis/StasisChamberRodPlugin.java
package com.kodari.stasis;

import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.command.PluginCommand;
import org.bukkit.plugin.java.JavaPlugin;

public final class StasisChamberRodPlugin extends JavaPlugin {
    @Override
    public void onEnable() {
        NamespacedKey rodKey = new NamespacedKey(this, "stasis_chamber_rod");
        StasisDataStore dataStore = new StasisDataStore(this);
        StasisRodItem rodItem = new StasisRodItem(rodKey);

        PluginCommand pearlRodCommand = getCommand("pearlrod");
        if (pearlRodCommand == null) {
            getLogger().severe("The pearlrod command is missing from plugin.yml.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        pearlRodCommand.setExecutor(new PearlRodCommand(rodItem));

        PluginCommand stasisCommand = getCommand("stasis");
        if (stasisCommand == null) {
            getLogger().severe("The stasis command is missing from plugin.yml.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }
        stasisCommand.setExecutor(new StasisCommand(dataStore));

        Bukkit.getPluginManager().registerEvents(new StasisRodListener(dataStore, rodItem), this);
    }
}