zygzak21837
📎 1 file 4,621 chars
📄
pasted-code-1787238173024.txt
txt 207 lines
▶
Create a complete Minecraft plugin from scratch called **ChaosCore**.

### ENVIRONMENT

* Minecraft: **1.20.1**
* Server software: **Paper**
* Language: **Java**
* Java: **JDK 21**
* Build system: **Maven**
* The plugin must work without Skript.
* Do not use unnecessary external plugins or addons.
* The code should be clean, stable, and easy to expand in the future.

### MAIN GOAL

ChaosCore should be a system of random events (“Chaos Events”) on a Minecraft server.

The plugin should automatically start random events at set intervals. An administrator should also be able to start events manually.

### COMMAND

Add the main command:

`/chaos`

Subcommands:

`/chaos start `
`/chaos stop`
`/chaos list`
`/chaos info`
`/chaos reload`

Add the appropriate permissions:

`chaos.admin`
`chaos.use`

### FIRST EVENTS

#### 1. Meteor Shower

The event lasts for a configurable number of seconds.

During the event:

* meteors fall in random locations,
* fire and explosion effects appear,
* players receive appropriate messages,
* the event should not destroy the entire map,
* meteors should spawn at a safe distance from players,
* a message appears when the event ends.

#### 2. Blood Moon

During the event:

* set the time to night,
* increase mob spawning,
* strengthen selected mobs,
* add red effects/particles,
* notify all players when the event starts.

#### 3. Thunder Chaos

During the event:

* lightning strikes randomly,
* lightning should not instantly kill players,
* add visual and sound effects,
* the event automatically ends after a configurable amount of time.

#### 4. Chaos Chest

A special chest appears in a random safe location.

The chest:

* has a custom name,
* contains random rewards,
* can only be opened during the event,
* disappears when the event ends.

### AUTOMATIC EVENT SYSTEM

Add a scheduler that:

* counts down to the next event,
* randomly selects an event,
* starts it automatically,
* displays a countdown to players,
* prevents two events from running at the same time,
* allows automatic events to be disabled in `config.yml`.

### MESSAGES

Use Minecraft color codes and make all messages configurable through `config.yml`.

Example:

`&8[&5ChaosCore&8] &d⚡ Chaos is starting!`

Add:

* event start message,
* event end message,
* countdown message,
* error message,
* no-permission message.

### TITLES AND SOUNDS

When an event starts:

* show players a Title,
* show a Subtitle,
* play an appropriate sound.

When an event ends:

* show a separate Title,
* play an ending sound.

### CONFIG.YML

Create a detailed `config.yml` where the following can be configured:

* time between events,
* duration of each event,
* automatic event activation,
* enabling/disabling individual events,
* messages,
* titles,
* sounds,
* rewards,
* event radius,
* worlds where events can occur.

### ARCHITECTURE

Separate the code into classes, for example:

`ChaosCore.java`

`commands/ChaosCommand.java`

`events/ChaosEvent.java`

`events/MeteorShowerEvent.java`

`events/BloodMoonEvent.java`

`events/ThunderChaosEvent.java`

`events/ChaosChestEvent.java`

`managers/EventManager.java`

`managers/ConfigManager.java`

`utils/MessageUtils.java`

You may adjust the structure if you have a better architecture.

### SAFETY

The plugin must not:

* crash the server,
* create infinite tasks,
* leave active schedulers running after the plugin is disabled,
* destroy the entire map,
* cause severe server lag.

All Bukkit/Paper tasks must be properly cancelled when the plugin is disabled.

### MAVEN

Generate a complete `pom.xml` for Paper 1.20.1 and Java 21.

Also generate a complete `plugin.yml`.

The plugin must have a correct main class, commands, permissions, and all required dependencies.

### IMPORTANT

Do not provide pseudocode.

Generate the **complete, working code for every file**.

For each file, provide its exact path, for example:

`src/main/java/.../ChaosCore.java`

Then provide the complete contents of that file.

At the end, explain step by step:

1. how to create the project in IntelliJ IDEA,
2. where to paste each file,
3. how to build the plugin using Maven,
4. where the `.jar` file will be located,
5. how to install it on a Paper 1.20.1 server,
6. how to launch and test ChaosCore.

The code should be prepared for someone who **does not know how to program**, so the instructions must be very detailed and should not skip any steps.
Kodari AI
KodariAug 20 at 3:06 pm 5
ChaosCore
ChaosCore is a Minecraft Paper plugin that introduces dynamic random events to the server. It features four distinct chaos events: Meteor Shower, Blood Moon, Thunder Chaos, and Chaos Chest. The plugin includes an automatic scheduler that randomly selects and starts events at configurable intervals, along with manual admin commands. Events feature custom titles, sounds, configurable messages, and safety measures to prevent map destruction. The system supports configurable event durations, radii, worlds, and rewards via a detailed config.yml file.
  1. Create the Maven/Paper project metadata and default configuration.

  2. Implement the core plugin, configuration, messaging, command, and event manager layers.

  3. Implement all four configurable chaos events with cleanup and safety handling.

  4. Add plugin registration and provide build/install/test instructions.

Implemented the complete ChaosCore Maven project.

Included files

  • pom.xml

  • src/main/resources/plugin.yml

  • src/main/resources/config.yml

  • src/main/java/com/kodari/chaoscore/ChaosCore.java

  • src/main/java/com/kodari/chaoscore/commands/ChaosCommand.java

  • src/main/java/com/kodari/chaoscore/managers/ConfigManager.java

  • src/main/java/com/kodari/chaoscore/managers/EventManager.java

  • src/main/java/com/kodari/chaoscore/events/ChaosEvent.java

  • src/main/java/com/kodari/chaoscore/events/MeteorShowerEvent.java

  • src/main/java/com/kodari/chaoscore/events/BloodMoonEvent.java

  • src/main/java/com/kodari/chaoscore/events/ThunderChaosEvent.java

  • src/main/java/com/kodari/chaoscore/events/ChaosChestEvent.java

  • src/main/java/com/kodari/chaoscore/utils/MessageUtils.java

Features implemented

  • /chaos start <event>

  • /chaos stop

  • /chaos list

  • /chaos info [event]

  • /chaos reload

  • chaos.use and chaos.admin permissions

  • Automatic random event scheduling

  • Event countdown messages

  • Configurable event durations

  • Configurable event enable/disable settings

  • Configurable worlds and event radius

  • Meteor showers with controlled explosions

  • Blood Moon with night-time effects and strengthened mobs

  • Thunder Chaos with visual lightning effects

  • Chaos Chest with configurable random rewards

  • Titles, subtitles, sounds, and messages

  • Cleanup of scheduled tasks and active events on shutdown

  • Java 21 and Paper 1.20.1 Maven configuration

Build instructions

  1. Install JDK 21.

  2. Install Maven.

  3. Create a folder named ChaosCore.

  4. Reproduce the generated file structure inside that folder.

  5. Open the folder in IntelliJ IDEA.

  6. Select File → Open and choose the ChaosCore folder.

  7. Allow IntelliJ IDEA to import the Maven project.

  8. Open a terminal in the project folder.

  9. Run:

Shell
mvn clean package

The compiled plugin will be located at:

Plain Text
target/ChaosCore.jar

Installation

  1. Stop the Paper 1.20.1 server.

  2. Copy target/ChaosCore.jar into the server’s:

Plain Text
plugins/
  1. Start the server.

  2. Edit the generated configuration at:

Plain Text
plugins/ChaosCore/config.yml
  1. Apply configuration changes with:

Plain Text
/chaos reload

Testing

Use:

Plain Text
/chaos list

Then start an event:

Plain Text
/chaos start meteor-shower
/chaos start blood-moon
/chaos start thunder-chaos
/chaos start chaos-chest

Stop the active event with:

Plain Text
/chaos stop

Automatic events are enabled by default and will begin according to settings.automatic.interval-seconds in config.yml.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
13 1,171
src/main/java/com/kodari/chaoscore/ChaosCore.java
package com.kodari.chaoscore;

import com.kodari.chaoscore.commands.ChaosCommand;
import com.kodari.chaoscore.managers.ConfigManager;
import com.kodari.chaoscore.managers.EventManager;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class ChaosCore extends JavaPlugin {
    private ConfigManager configManager;
    private EventManager eventManager;

    @Override
    public void onEnable() {
        this.configManager = new ConfigManager(this);
        this.configManager.load();
        this.eventManager = new EventManager(this);

        ChaosCommand command = new ChaosCommand(this);
        if (getCommand("chaos") != null) {
            getCommand("chaos").setExecutor(command);
            getCommand("chaos").setTabCompleter(command);
        }
        this.eventManager.startAutomaticScheduler();
        getLogger().info("ChaosCore enabled with " + eventManager.getEventIds().size() + " chaos events.");
    }

    @Override
    public void onDisable() {
        if (eventManager != null) {
            eventManager.shutdown();
        }
    }

    public ConfigManager getConfigManager() {
        return configManager;
    }

    public EventManager getEventManager() {
        return eventManager;
    }
}