L
📎 1 file 4,014 chars
📄
pasted-code-1773222369331.txt
txt 254 lines
▶
Create a professional Minecraft plugin with the following specifications.

Plugin Name:
RadiusChecker

Target Minecraft Version:
1.21.11

Server Software:
Paper

Java Version:
Java 21

Goal:
Create a high-performance plugin that detects when a player kills another player inside specific custom zones and reports the information to admins and Discord.

---

CORE SYSTEM

The plugin must allow administrators to create multiple custom zones in the world.

Each zone should detect player kills inside its area and report the event.

---

ZONE CREATION COMMANDS

Admins must be able to control zones using these commands:

/zone create 
Creates a new zone.

/zone activate 
Activates the zone.

/zone deactivate 
Disables the zone.

/zone delete 
Deletes the zone.

/zone reload
Reloads the plugin configuration.

---

ZONE WAND SYSTEM

Admins can use a wand to visually create zones.

Command:

/zone wand

This command gives the player a special wand item.

Item:
Blaze Rod

Name:
Zone Selector Wand

Selection system:

Left click block → set position 1
Right click block → set position 2

After selecting two positions the plugin must calculate:

• Zone center
• Zone size

---

ZONE SIZE SYSTEM (IMPORTANT)

If the admin sets radius to 50 blocks the plugin must NOT treat it as a circular radius.

Instead it must create a square area.

Example:

radius = 50

Zone size:

50 blocks in X direction
50 blocks in Z direction

Final area covered:

50 × 50 blocks square.

---

FULL Y LEVEL COVERAGE (IMPORTANT)

Zones must cover the entire world height.

The plugin must NOT use limited vertical radius like "50 blocks up and 50 blocks down".

Instead the zone must automatically cover:

World minimum height → World maximum height.

Example:

World height:
Y -64 → Y 320

Zone must detect kills at ANY Y level inside the zone.

---

ZONE PARTICLE VISUALIZATION

Zones should be visually visible.

Particles must appear around the zone border.

Requirements:

• Small particles
• Thin border line
• Must not cause lag
• Must be optimized

Particles should appear as a square border around the zone.

---

KILL DETECTION SYSTEM

When a player kills another player inside a zone the plugin must detect it.

Information to collect:

• Killer name
• Victim name
• Zone ID
• Exact coordinates
• World name
• Time of kill

---

ADMIN ALERT SYSTEM

If admins are online they should receive a chat message.

Example message:

[RadiusChecker]
Player  killed 
Zone: 
Location: 

Only players with permission should receive alerts.

Permission:
radiuschecker.alert

---

DISCORD WEBHOOK LOGGING

The plugin must support Discord webhook logging.

When a kill happens inside a zone the plugin sends a webhook message containing:

• Killer
• Victim
• Zone ID
• Coordinates
• World
• Time

Use a formatted Discord embed message.

Webhook URL must be configurable in config.yml.

---

ZONE HISTORY SYSTEM

The plugin must store kill history.

Admins can view history with:

/zone history

This command should show recent zone kills.

---

CONFIG FILE

config.yml should store all zones.

Example structure:

zones:
spawn:
world: world
x: 100
z: 200
size: 50
active: true

Webhook:
url: "DISCORD_WEBHOOK_URL"

---

PERMISSIONS

radiuschecker.admin
radiuschecker.alert
radiuschecker.wand

---

PERFORMANCE REQUIREMENTS

This plugin must be optimized for large servers.

Requirements:

• No heavy loops
• No lag spikes
• Efficient zone detection
• Clean memory usage
• No server crashes

---

CODE QUALITY

The code must be:

• Clean and well structured
• Properly commented
• Modular design
• Error handled
• Compatible with Paper 1.21.11

---

GOAL

Create a stable and professional Minecraft plugin suitable for production servers.
Kodari AI
KodariMar 11 at 9:48 am 23,675 (v2)

I’ll create a professional PvP zone detection plugin with Discord integration and visual borders.

RadiusChecker
A high-performance zone monitoring plugin that detects player kills inside custom square zones. Features include visual particle borders, real-time admin notifications, Discord webhook integration, and comprehensive kill history tracking. Optimized for large Paper servers with efficient zone detection and minimal performance impact.

Plugin created with the following features:

Core Systems:

  • Square zone detection with full Y-axis coverage (world min to max height)

  • Visual particle borders using flame particles around zone edges

  • High-performance kill detection with zone validation

  • Discord webhook integration with formatted embed messages

  • Comprehensive kill history tracking (last 100 records by default)

Commands:

  • /zone create <id> - Creates zone from wand selection

  • /zone activate/deactivate <id> - Toggle zone status

  • /zone delete <id> - Removes zone

  • /zone wand - Get selection tool (Blaze Rod)

  • /zone list - View all configured zones

  • /zone history - View recent kills

  • /zone reload - Reload configuration

Technical Highlights:

  • XSeries for cross-version compatibility (Materials, Particles)

  • Lombok for clean data models

  • Async Discord webhook sending (no server lag)

  • Optimized particle rendering at mid-height

  • Tab completion for all commands

  • Permission-based admin alerts

The wand selection calculates square zones automatically, and particles visualize borders every 20 ticks (configurable). All zones persist in config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
manifest.kod
Code
16 1,031
src/main/java/com/example/radiuschecker/RadiusChecker.java
package com.example.radiuschecker;

import com.example.radiuschecker.commands.ZoneCommand;
import com.example.radiuschecker.listeners.PlayerDeathListener;
import com.example.radiuschecker.listeners.WandListener;
import com.example.radiuschecker.managers.HistoryManager;
import com.example.radiuschecker.managers.WebhookManager;
import com.example.radiuschecker.managers.ZoneManager;
import com.example.radiuschecker.tasks.ParticleTask;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class RadiusChecker extends JavaPlugin {
    private ZoneManager zoneManager;
    private HistoryManager historyManager;
    private WebhookManager webhookManager;
    private WandListener wandListener;
    private ParticleTask particleTask;
    
    @Override
    public void onEnable() {
        saveDefaultConfig();
        
        this.zoneManager = new ZoneManager(this);
        this.historyManager = new HistoryManager(this);
        this.webhookManager = new WebhookManager(this);
        this.wandListener = new WandListener();
        
        Bukkit.getPluginManager().registerEvents(wandListener, this);
        Bukkit.getPluginManager().registerEvents(new PlayerDeathListener(this), this);
        
        ZoneCommand zoneCommand = new ZoneCommand(this, wandListener);
        getCommand("zone").setExecutor(zoneCommand);
        getCommand("zone").setTabCompleter(zoneCommand);
        
        int particleInterval = getConfig().getInt("settings.particle-interval", 20);
        this.particleTask = new ParticleTask(this);
        this.particleTask.runTaskTimer(this, 20L, particleInterval);
        
        getLogger().info("RadiusChecker v" + getDescription().getVersion() + " enabled!");
        getLogger().info("Loaded " + zoneManager.getZones().size() + " zone(s)");
    }
    
    @Override
    public void onDisable() {
        if (particleTask != null) {
            particleTask.cancel();
        }
        
        getLogger().info("RadiusChecker disabled!");
    }
}