V
📎 1 file 2,557 chars
📄
pasted-code-1776186316071.txt
txt 113 lines
▶
Create a modern, optimized Minecraft plugin for Paper/Spigot 1.21.1+ named EzFishing.

This plugin is a region-based fishing event system where players can only fish for custom rewards inside defined areas during active events.

⸻

🔧 Core System

Players can use:
	•	/fishing wand → gives a selection wand to define a region (pos1 / pos2)
	•	/fishing create  → creates a fishing event zone
	•	/fishing delete 
	•	/fishing list
	•	/fishing reload

Each region must be saved and fully configurable.

⸻

🎣 Fishing Event Mechanics

Each fishing region runs on a timed event system:
	•	⏱ Active Time: 10 minutes
	•	❄️ Cooldown Time: 30 minutes
	•	Only ONE state per region: ACTIVE or COOLDOWN
	•	Players can ONLY fish during ACTIVE events
	•	If inactive → fishing is blocked with a custom message

⸻

🎁 Loot System (IMPORTANT UPDATE)

When fishing in an active region:
	•	Players receive INGOTS only (NO ORES)
	•	Example loot:
	•	Iron Ingot
	•	Gold Ingot
	•	Diamond (treated as ingot item)
	•	Emerald
	•	Netherite Scrap (rare)

Loot Behavior:
	•	2–5 different ingots per fishing catch
	•	Each item drops 3–6 amount randomly
	•	Loot weights reduced by 20% (balanced system)

⸻

📝 Item Description (NEW FEATURE)

Every loot item must include a lore description:

Example:
	•	“§7Rare fishing reward”
	•	“§eSell this item using §a/sell §eto earn money!”

All ingots must contain:
	•	Clear rarity color (Common / Rare / Epic)
	•	Sell instruction lore:
	•	(/sell to sell this item)

⸻

📢 Event Broadcast System

When events:
	•	Start → broadcast message + epic sound
	•	End → broadcast message + sound

Example:
	•	“🎣 Fishing Event Started in {region}!”
	•	“⏳ Fishing Event Ended! Next event in 30 minutes!”

⸻

📊 UI FEATURES
	•	ActionBar Timer
	•	Shows remaining event time
	•	Shows cooldown time when inactive
	•	Only visible inside fishing region

⸻

⚙️ CONFIG.YML MUST INCLUDE

Fully customizable options:
	•	Prefix + all messages
	•	Event timing (10 min / 30 min)
	•	Cooldown timing (30 min)
	•	Loot table (INGOTS ONLY)
	•	Item lore (including sell message)
	•	Weight multiplier (-20%)
	•	Wand item + name
	•	Sound effects
	•	Broadcast toggle
	•	Actionbar format
	•	Region settings

⸻

🧠 TECH REQUIREMENTS
	•	Clean OOP structure
	•	Region Manager system
	•	Event Scheduler system
	•	Loot Manager system
	•	Command handler system
	•	Fully optimized (no lag / async safe where possible)

⸻

🚀 FINAL GOAL

The plugin should feel like a premium RPG-style fishing event system, simple to use but powerful, with balanced rewards and a modern server experience.
Kodari AI
KodariApr 14 at 5:08 pm 16,541 (v2)

I’ll create a modern region-based fishing event plugin with timed events, custom loot, and ActionBar timers.

EzFishing
A region-based fishing event system where players fish for custom ingot rewards inside defined areas during active timed events. Features wand-based region selection, automated event cycling with 10-minute active periods and 30-minute cooldowns, customizable loot tables with ingots, ActionBar timers showing event status, broadcast notifications with sounds, and full configuration support.

All files created successfully!

EzFishing is now ready with:

  • ✅ Region-based fishing system with wand selection

  • ✅ Timed event cycling (10min active / 30min cooldown)

  • ✅ Custom loot system (ingots only, 2-5 items per catch, 3-6 amount each)

  • ✅ ActionBar timer display showing remaining time

  • ✅ Event broadcast system with sounds

  • ✅ Full command suite (/fishing wand, create, delete, list, reload)

  • ✅ Fully configurable via config.yml

  • ✅ Persistent region storage via regions.yml

  • ✅ XSeries integration for cross-version compatibility

  • ✅ Clean OOP architecture with separate managers

Build with gradle build and drop into plugins folder. All loot items include custom lore with sell instructions as requested!

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
Code
21 1,238
src/main/java/com/example/ezfishing/EzFishing.java
package com.example.ezfishing;

import com.example.ezfishing.command.FishingCommand;
import com.example.ezfishing.event.EventScheduler;
import com.example.ezfishing.listener.FishingListener;
import com.example.ezfishing.listener.PlayerMoveListener;
import com.example.ezfishing.listener.SelectionListener;
import com.example.ezfishing.loot.LootManager;
import com.example.ezfishing.region.RegionData;
import com.example.ezfishing.region.RegionManager;
import com.example.ezfishing.selection.SelectionManager;
import lombok.Getter;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

@Getter
public class EzFishing extends JavaPlugin {
    private ConfigManager configManager;
    private MessageManager messageManager;
    private RegionManager regionManager;
    private RegionData regionData;
    private LootManager lootManager;
    private EventScheduler eventScheduler;
    private SelectionManager selectionManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.messageManager = new MessageManager(this);
        this.regionData = new RegionData(this);
        this.regionManager = new RegionManager(this);
        this.lootManager = new LootManager(this);
        this.selectionManager = new SelectionManager();
        this.eventScheduler = new EventScheduler(this);

        this.regionData.loadRegions();

        Bukkit.getPluginManager().registerEvents(new FishingListener(this), this);
        Bukkit.getPluginManager().registerEvents(new SelectionListener(this), this);
        Bukkit.getPluginManager().registerEvents(new PlayerMoveListener(this), this);

        this.getCommand("fishing").setExecutor(new FishingCommand(this));

        this.eventScheduler.start();

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

    @Override
    public void onDisable() {
        if (this.eventScheduler != null) {
            this.eventScheduler.stop();
        }
        if (this.regionData != null) {
            this.regionData.saveRegions();
        }
        this.getLogger().info("EzFishing has been disabled!");
    }

    public void reload() {
        this.configManager.reload();
        this.lootManager.reload();
        this.regionData.loadRegions();
    }
}