Implement the user's Minecraft plugin feature in this project. User requirements: make a custom item called “Rabbit Burrow” using black dye (BLACK_DYE), usable by right-click. On use, play an expanding particle animation and create a temporary, inescapable hemispherical enclosure around the wielder for 5 seconds. The enclosure blocks must be SANDSTONE, not bedrock. Prevent trapped players from walking or teleporting out for the full duration; apply a 25-second cooldown per wielder. After the 5 seconds, remove/restore the temporary enclosure safely so the world is not permanently changed. Stop repetitive chat output when using the item: do not emit chat spam and do not use the old “[bedrockdye]” label/prefix anywhere; if a prefix is needed, use “[Rabbit Burrow]”. Ensure the item's displayed name and all related user-facing names use “Rabbit Burrow”, not “Bedrock Sword/Bedrock Dye”. Inspect the existing scaffold and implement appropriate listener, item recognition, and configuration/registration for this plugin's actual API/version. Use sensible radius/defaults if none are provided, and do not invent extra unrelated features. Report files changed and key behavior when done; do not attempt to compile/build.

Kodari AI
KodariOct 3 at 1:08 pm 1
RabbitBurrow
Adds a custom "Rabbit Burrow" item crafted from black dye that, when right-clicked, creates a temporary hemispherical sandstone enclosure around the wielder for 5 seconds. The enclosure traps players inside, preventing walking or teleporting out during the duration. Features a 25-second per-player cooldown, expanding particle animation on activation, and safe automatic removal of the temporary blocks afterward to avoid permanent world changes. Uses the "[Rabbit Burrow]" prefix for any messaging without chat spam.
  • Establish a minimal Paper 1.21.4 project structure; the workspace has no existing scaffold.

  • Add a tagged BLACK_DYE Rabbit Burrow item and a /rabbitburrow command to obtain it.

  • Implement the expanding particles, temporary sandstone dome, movement/teleport containment, cooldown, and block restoration.

Created a Paper 1.21.4 / Java 21 plugin. The workspace had no existing scaffold.

  • Added a uniquely tagged Rabbit Burrow item made from BLACK_DYE, obtainable with /rabbitburrow.

  • Right-clicking it creates an expanding particle effect and a temporary sandstone dome. Trapped players cannot walk or teleport outside; breaking temporary blocks is also prevented.

  • The dome restores replaced blocks after the configured duration. Defaults are a 4-block radius, 5-second duration, and 25-second per-wielder cooldown.

  • Using the item produces no chat message.

Files created: build.gradle, settings.gradle, plugin.yml, config.yml, and RabbitBurrowPlugin.java. I did not run a build.

Zapiekanka

this capsule is supposed to be much bigger, like 9x9x9, the material should be bedrock and the blocks inside this sphere automatically turn into sandstone, on the chat it should show how many seconds are left if you want to use it

Kodari AI
KodariOct 3 at 1:26 pm 1
  1. Update the enclosure to a 9×9×9 bedrock capsule and convert its interior to temporary sandstone.

  2. Add a cooldown message showing the remaining seconds when the item is reused.

Updated RabbitBurrowPlugin.java:

  • The enclosure is now a full 9×9×9 sphere with a bedrock shell.

  • Solid blocks inside the shell become temporary sandstone; air stays open so players can move inside.

  • Right-clicking during cooldown shows the remaining seconds with a [Rabbit Burrow] prefix.

  • Temporary changes are restored when the enclosure expires.

The cooldown message appears when the item is tried again during cooldown; there’s no automatic countdown spam.

Zapiekanka

where i can dowload

Kodari AI
KodariOct 3 at 1:27 pm 1

Open the project’s Download/Export option to get the source files as a ZIP. I haven’t built a plugin .jar, so there isn’t an installable server download yet.

Update the existing RabbitBurrow plugin in place for the user's latest requirements. Read the current Java/config first. Current code is src/main/java/com/kodari/rabbitburrow/RabbitBurrowPlugin.java and config src/main/resources/config.yml. Ensure default Rabbit Burrow enclosure is a 9x9x9 total block-sized sphere/capsule (radius 4 from center block gives 9 blocks across in each axis); use BEDROCK for the outer shell and convert existing solid blocks in the sphere's interior to SANDSTONE. Keep interior air passable so players are not entombed; maintain temporary block lease/original-state restoration after the configured duration, 5 sec default, plus current containment/cooldown behavior. Set config default radius to 4 and adjust validation if needed so it stays 9x9x9 by default. On right-click during cooldown, send one concise chat message showing exact remaining seconds (rounded up), e.g. '[Rabbit Burrow] Available in 12 seconds.' No chat spam while item is usable; only send on rejected use. Preserve BLACK_DYE item, Rabbit Burrow naming, 25-second default cooldown, particle animation, and current command. Do not add unrelated features. Make sure user-visible material and dimensions agree and update config/documentation only if relevant. Report files changed and behavior; do not attempt compile/build.

Kodari AI
KodariOct 3 at 1:29 pm 1
  1. Read the current plugin and config to confirm the existing implementation.

  2. Update enclosure dimensions/materials, cooldown feedback, and the matching default config.

Updated RabbitBurrowPlugin.java. The existing defaults already create a radius-4 sphere with a 9×9×9 bounding size, a bedrock shell, and sandstone replacing solid interior blocks while leaving air open. On cooldown, the player now sees one concise message with the remaining seconds rounded up, such as “[Rabbit Burrow] Available in 12 seconds.”

No config change was needed. I did not build the project.

Update the existing RabbitBurrow plugin so sandstone inside the enclosure is breakable during the active burrow, as requested by the user (“ale ten sandstone ma mozna niszczyc” / but that sandstone should be breakable). Current file: src/main/java/com/kodari/rabbitburrow/RabbitBurrowPlugin.java. Current onBlockBreak around line 156 cancels breaks for every block in leasedBlocks, which protects both bedrock and sandstone. Adjust behavior narrowly: continue protecting temporary BEDROCK shell blocks from breaking, but allow breaks of temporary SANDSTONE interior blocks. Preserve cooldown, containment, 5-second duration, 9x9x9 dimensions, and cleanup/restoration behavior. Do not add chat spam or unrelated features. Inspect current source as needed, report exactly what changed. Do not compile/build.

Kodari AI
KodariOct 3 at 1:35 pm 1
  1. Check each leased block’s current temporary material on break.

  2. Cancel breaks only for bedrock; leave temporary sandstone breakable.

Updated RabbitBurrowPlugin.java: temporary bedrock shell blocks remain protected from breaking, while temporary sandstone inside the enclosure can now be broken. Cooldown, containment, duration, dimensions, and cleanup/restoration behavior are unchanged. I did not build the project.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
5 398
src/main/java/com/kodari/rabbitburrow/RabbitBurrowPlugin.java
package com.kodari.rabbitburrow;

import com.cryptomorin.xseries.XMaterial;
import com.cryptomorin.xseries.particles.XParticle;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.Particle;
import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.scheduler.BukkitTask;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;

public final class RabbitBurrowPlugin extends JavaPlugin implements Listener, CommandExecutor {
    private final Map<UUID, Long> cooldowns = new HashMap<>();
    private final Map<UUID, Cage> cages = new HashMap<>();
    private final Map<Block, BlockLease> leasedBlocks = new HashMap<>();

    private Material blackDye;
    private Material bedrock;
    private Material sandstone;
    private NamespacedKey itemKey;
    private int radius;
    private int durationTicks;
    private int cooldownSeconds;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        blackDye = XMaterial.matchXMaterial("BLACK_DYE").map(XMaterial::parseMaterial).orElse(null);
        bedrock = XMaterial.matchXMaterial("BEDROCK").map(XMaterial::parseMaterial).orElse(null);
        sandstone = XMaterial.matchXMaterial("SANDSTONE").map(XMaterial::parseMaterial).orElse(null);
        if (blackDye == null || bedrock == null || sandstone == null) {
            getLogger().severe("Required item materials are unavailable on this server.");
            getServer().getPluginManager().disablePlugin(this);
            return;
        }

        itemKey = new NamespacedKey(this, "rabbit_burrow");
        radius = Math.max(2, Math.min(8, getConfig().getInt("rabbit-burrow.radius", 4)));
        int durationSeconds = Math.max(1, Math.min(1200, getConfig().getInt("rabbit-burrow.duration-seconds", 5)));
        cooldownSeconds = Math.max(1, Math.min(86400, getConfig().getInt("rabbit-burrow.cooldown-seconds", 25)));
        durationTicks = durationSeconds * 20;

        getServer().getPluginManager().registerEvents(this, this);
        getCommand("rabbitburrow").setExecutor(this);
    }

    @Override
    public void onDisable() {
        for (Cage cage : new ArrayList<>(cages.values())) {
            removeCage(cage);
        }
        cooldowns.clear();
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!(sender instanceof Player player)) {
            sender.sendMessage("Only players can use this command.");
            return true;
        }
        if (!player.hasPermission("rabbitburrow.give")) {
            player.sendMessage(ChatColor.RED + "You don't have permission to do that.");
            return true;
        }

        for (ItemStack leftover : player.getInventory().addItem(createRabbitBurrowItem()).values()) {
            player.getWorld().dropItemNaturally(player.getLocation(), leftover);
        }
        player.sendMessage(ChatColor.GREEN + "You received Rabbit Burrow.");
        return true;
    }

    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onUse(PlayerInteractEvent event) {
        if (event.getHand() != EquipmentSlot.HAND
                || (event.getAction() != Action.RIGHT_CLICK_AIR && event.getAction() != Action.RIGHT_CLICK_BLOCK)
                || !isRabbitBurrowItem(event.getItem())) {
            return;
        }

        event.setCancelled(true);
        Player player = event.getPlayer();
        long now = System.currentTimeMillis();
        long readyAt = cooldowns.getOrDefault(player.getUniqueId(), 0L);
        if (now < readyAt) {
            long remainingSeconds = (readyAt - now + 999L) / 1000L;
            player.sendMessage(ChatColor.GRAY + "[Rabbit Burrow] " + ChatColor.RED
                    + "Available in " + remainingSeconds + " seconds.");
            return;
        }

        Cage cage = createCage(player);
        cages.put(player.getUniqueId(), cage);
        for (Player nearby : cage.world.getPlayers()) {
            if (cage.contains(nearby.getLocation())) {
                cage.trappedPlayers.add(nearby.getUniqueId());
            }
        }
        cage.trappedPlayers.add(player.getUniqueId());

        placeCageBlocks(cage);
        long cooldownEndsAt = now + cooldownSeconds * 1000L;
        cooldowns.put(player.getUniqueId(), cooldownEndsAt);
        Bukkit.getScheduler().runTaskLater(this, () -> cooldowns.remove(player.getUniqueId(), cooldownEndsAt), cooldownSeconds * 20L);
        cage.expirationTask = Bukkit.getScheduler().runTaskLater(this, () -> removeCage(cage), durationTicks);
        playExpansion(cage);
    }

    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onMove(PlayerMoveEvent event) {
        if (event instanceof PlayerTeleportEvent || event.getTo() == null) {
            return;
        }
        if (isLeavingAnyCage(event.getPlayer(), event.getTo())) {
            event.setCancelled(true);
        }
    }

    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onTeleport(PlayerTeleportEvent event) {
        if (event.getTo() != null && isLeavingAnyCage(event.getPlayer(), event.getTo())) {
            event.setCancelled(true);
        }
    }

    @EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
    public void onBlockBreak(BlockBreakEvent event) {
        BlockLease lease = leasedBlocks.get(event.getBlock());
        if (lease != null && lease.temporaryType == bedrock) {
            event.setCancelled(true);
        }
    }

    private ItemStack createRabbitBurrowItem() {
        ItemStack item = new ItemStack(blackDye);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(ChatColor.DARK_GRAY + "Rabbit Burrow");
        meta.getPersistentDataContainer().set(itemKey, PersistentDataType.BYTE, (byte) 1);
        item.setItemMeta(meta);
        return item;
    }

    private boolean isRabbitBurrowItem(ItemStack item) {
        if (item == null || item.getType() != blackDye || !item.hasItemMeta()) {
            return false;
        }
        return item.getItemMeta().getPersistentDataContainer().has(itemKey, PersistentDataType.BYTE);
    }

    private Cage createCage(Player player) {
        Location location = player.getLocation();
        return new Cage(player.getUniqueId(), location.getWorld(), location.getBlockX(), location.getBlockY(), location.getBlockZ(), radius);
    }

    private void placeCageBlocks(Cage cage) {
        int outerRadiusSquared = cage.radius * cage.radius;
        int innerRadiusSquared = (cage.radius - 1) * (cage.radius - 1);
        for (int dx = -cage.radius; dx <= cage.radius; dx++) {
            for (int dy = -cage.radius; dy <= cage.radius; dy++) {
                for (int dz = -cage.radius; dz <= cage.radius; dz++) {
                    int distanceSquared = dx * dx + dy * dy + dz * dz;
                    if (distanceSquared > outerRadiusSquared) {
                        continue;
                    }

                    Block block = cage.world.getBlockAt(cage.centerX + dx, cage.baseY + dy, cage.centerZ + dz);
                    if (distanceSquared > innerRadiusSquared) {
                        leaseBlock(cage, block, bedrock);
                    } else if (!block.isPassable()) {
                        leaseBlock(cage, block, sandstone);
                    }