allayontop

Make me an plugin where i do /donutrtpzone wand and then i get a hoe to break blocks to register the blocks and when poeple stand on the register blocks they get rtped every 1 Minute or smth with a placeholder for the coundoun

Kodari AI
KodariApr 15 at 8:51 am 12,840 (v2)

I’ll create a zone-based RTP plugin with block registration and countdown system.

DonutRTPZone
A zone-based random teleportation system where admins can mark blocks with a wand tool, and players standing on marked blocks are automatically teleported to random locations after a countdown. Features persistent zone storage, configurable RTP settings, countdown placeholders via PlaceholderAPI, world whitelist/blacklist, safe location detection, and admin management commands for zone control.

Project created successfully!

DonutRTPZone is a zone-based RTP system where:

  • Admins use /donutrtpzone wand to get a diamond hoe

  • Left-click blocks to register them as RTP zones, right-click to unregister

  • Players standing on registered blocks get teleported after 60 seconds (configurable)

  • PlaceholderAPI placeholders: %donutrtp_countdown%, %donutrtp_countdown_formatted%, %donutrtp_zone_count%

  • Includes particle/sound effects, safe location detection, and persistent zone storage

allayontop

Make it after i selected the blocks i need to do /donutrtpzone create %name% and for the placeholders i do %donutrtp_countdown_formatted_%name%% so that i can see the countdoun only for this area

Kodari AI
KodariApr 15 at 9:01 am 33,807 (v2)

I’ll read all the existing files to understand the structure and implement the zone creation command and named placeholders.

I’ll implement named zones with a selection system and zone-specific placeholders.

Plan:

  • Add SelectionManager to track player block selections

  • Update ZoneBlock to include zone names

  • Modify wand to select blocks (not register immediately)

  • Add /donutrtpzone create <name> command

  • Update placeholders to support %donutrtp_countdown_formatted_<zonename>%

All files have been updated. The system now works as follows:

  1. Select a block: Use the wand (left-click/break) to select a block location

  2. Create named zone: /donutrtpzone create <name> to create a zone with that name

  3. Zone-specific placeholders:

    • %donutrtp_countdown_formatted_<zonename>% - Shows countdown only when on that specific zone

    • %donutrtp_countdown_<zonename>% - Raw seconds for specific zone

    • %donutrtp_current_zone% - Shows which zone the player is currently on

    • %donutrtp_countdown_formatted% - Shows countdown for any zone

  4. Delete zones: /donutrtpzone delete <name> to remove a named zone

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
16 1,256
src/main/java/com/donutmc/rtpzone/DonutRTPZone.java
package com.donutmc.rtpzone;

import com.donutmc.rtpzone.command.WandCommand;
import com.donutmc.rtpzone.listener.PlayerMoveListener;
import com.donutmc.rtpzone.listener.WandListener;
import com.donutmc.rtpzone.manager.ConfigManager;
import com.donutmc.rtpzone.manager.PlayerTrackerManager;
import com.donutmc.rtpzone.manager.RTPManager;
import com.donutmc.rtpzone.manager.SelectionManager;
import com.donutmc.rtpzone.manager.ZoneManager;
import com.donutmc.rtpzone.placeholder.RTPPlaceholder;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public final class DonutRTPZone extends JavaPlugin {

    private ConfigManager configManager;
    private ZoneManager zoneManager;
    private RTPManager rtpManager;
    private PlayerTrackerManager playerTrackerManager;
    private SelectionManager selectionManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.zoneManager = new ZoneManager(this);
        this.rtpManager = new RTPManager(this);
        this.playerTrackerManager = new PlayerTrackerManager(this);
        this.selectionManager = new SelectionManager();

        getCommand("donutrtpzone").setExecutor(new WandCommand(this));
        
        Bukkit.getPluginManager().registerEvents(new WandListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerMoveListener(this), this);

        if (Bukkit.getPluginManager().getPlugin("PlaceholderAPI") != null) {
            new RTPPlaceholder(this).register();
            getLogger().info("PlaceholderAPI hooked successfully!");
        }

        playerTrackerManager.startTracking();

        getLogger().info("DonutRTPZone has been enabled!");
    }

    @Override
    public void onDisable() {
        if (playerTrackerManager != null) {
            playerTrackerManager.stopTracking();
        }
        if (zoneManager != null) {
            zoneManager.saveZones();
        }
        getLogger().info("DonutRTPZone has been disabled!");
    }
}