sykicgotqd

🔥 ShineSMP — Start Event System (Minecraft Java 1.21.x)

Act as a professional Minecraft Java plugin developer. Implement a complete, polished SMP start-event system for my existing ShineSMP plugin, compatible with Minecraft Java 1.21.x using Paper.

  1. Start Command
  • Command: "/ShineSmpStart on"
  • Only OPs or authorized administrators can use it.
  • Start the event only once; prevent duplicate executions.
  • Broadcast a message when the event begins.
  • If the event is already running, show an appropriate error message.
  1. Countdown — Above the Hotbar

When an operator executes "/ShineSmpStart on":

  • Start a 10-second countdown for every online player.
  • Display the countdown continuously in the action bar, directly above the hotbar.
  • Every player must see the countdown simultaneously.
  • Display: "🔥 ShineSMP starts in: 10"
  • Continue from "10, 9, 8 ... 2, 1".
  • At zero, display: "§c§l🔥 SHINESMP HAS STARTED!"
  • Play configurable countdown and start sounds.
  • Use a scheduled task that updates the action bar once per second.
  1. Launch Effect

Immediately after the countdown ends:

  • Apply the Levitation effect to every online player.
  • Make the effect duration and amplifier configurable in "config.yml".
  • Ensure the launch gives players enough height and time to activate Elytra flight.
  • Handle survival-mode players safely.
  • Stop the launch effect at the appropriate time so it does not interfere with gliding.
  1. Temporary Elytra

Give every participating player one temporary Elytra when the event starts.

Requirements:

  • The Elytra must work normally and allow gliding.
  • Mark every event Elytra with a unique persistent data identifier.
  • Detect when a player lands on a solid block after gliding.
  • Remove only the event-issued Elytra from the player's inventory when they land.
  • Never delete a player's original Elytra.
  • Prevent temporary Elytra duplication, dropping, storing in chests, or transferring to other players.
  • Handle disconnects, reconnects, death, and inventory changes.
  • If a player disconnects while airborne, continue tracking the event Elytra correctly when they return.
  • Make the temporary Elytra's name and lore configurable.

Note: The Elytra should be temporary, but it must still be a functional Minecraft Elytra.

  1. Starting Supplies

When the countdown ends, give each participating player:

  • "32x COOKED_PORKCHOP"

Requirements:

  • Give exactly 32 cooked porkchops per player per event.
  • Handle full inventories safely by dropping the remaining items nearby.
  • Do not duplicate supplies if the command is accidentally executed again.
  1. World Border

When the event begins:

  • Set the main survival world's border diameter to 2,000 blocks.
  • Default center coordinates: "0, 0".
  • Make the world name, center coordinates, and border diameter configurable.
  • Apply the border only to the configured world.
  • Do not change unrelated worlds.

A 2,000-block diameter means approximately 1,000 blocks in each direction from the center.

  1. Grace Period — 15 Minutes

At the end of the start countdown, activate a 15-minute Grace Period.

During the Grace Period:

  • Disable player-versus-player damage.
  • Prevent players from killing other players through melee attacks, projectiles, tridents, or other damage sources.
  • Prevent indirect PvP damage caused by player-owned entities where practical.
  • Do not disable normal environmental damage, mob damage, or fall damage unless explicitly configured.
  • Show the remaining Grace Period time in the action bar above the hotbar for every player.
  • Display the remaining time in "MM:SS" format.
  • Broadcast a message when Grace Period begins.
  • Broadcast a clear message when the 15 minutes end.
  • Restore normal PvP automatically when the timer reaches zero.
  • Ensure PvP protection cannot be bypassed by relogging or changing worlds.
  1. Action Bar Priority

All players must see the appropriate status above their hotbar.

Examples:

  • During the initial countdown: "🔥 ShineSMP starts in: 10"
  • During Grace Period: "🛡 Grace Period: 14:59"
  • When Grace Period ends: "⚔ PvP is now enabled!"

The countdown and Grace Period timer must not overwrite one another incorrectly. Use a single action-bar manager with clear priority rules.

  1. Configuration

Create a configurable "config.yml" containing:

  • Countdown duration: "10" seconds.
  • Grace Period duration: "900" seconds.
  • Starting food: "32".
  • World border diameter: "2000".
  • Main world name.
  • Border center X and Z.
  • Levitation duration and amplifier.
  • Countdown and event messages.
  • Action-bar formatting.
  • Sounds.
  • Temporary Elytra name and lore.
  • PvP protection settings.
  1. Commands and Permissions

Implement:

  • "/ShineSmpStart on" — starts the event.
  • "/ShineSmpStart status" — shows the event state and remaining Grace Period.
  • "/ShineSmpStart reset" — resets the event state; OP/admin permission required.

Use appropriate permission nodes and provide them in "plugin.yml".

  1. Technical Requirements
  • Minecraft Java Edition 1.21.x.
  • Paper API.
  • Clean, modular Java code.
  • Correct event listeners and scheduled tasks.
  • Persistent data tags for temporary items.
  • Proper cleanup on plugin disable.
  • No console errors, duplicate timers, or memory leaks.
  • Include complete Java source code, "plugin.yml", "config.yml", Maven "pom.xml", and installation instructions.

Expected Result

An operator runs "/ShineSmpStart on". All players see a 10-to-1 countdown above the hotbar. When it ends, every player receives Levitation, 32 cooked porkchops, and a temporary functional Elytra. The world border becomes 2,000 blocks in diameter, and a 15-minute Grace Period begins. The action bar displays the remaining Grace Period time. When a player lands, their temporary Elytra is removed, and after 15 minutes, normal PvP is automatically enabled.

Kodari AI
KodariOct 17 at 11:01 am 2
ShineSmpStartSystem
Implements a comprehensive SMP start event system for Paper 1.21.x. Features an OP-only start command with a 10-second synchronized action bar countdown, configurable levitation launch effect, temporary functional Elytra with persistent data tags that auto-remove on landing while preserving original Elytra, starting supplies of 32 cooked porkchops, configurable world border application, and a 15-minute grace period with PvP protection. Includes a priority-based action bar manager handling countdown, grace period timer in MM:SS format, and PvP enabled messages. Provides status and reset commands with permissions, full config.yml customization for durations, sounds, messages, and effects, plus proper cleanup on disable.
  1. Create the Paper 1.21 plugin entry point, command, and event manager.

  2. Add protected temporary Elytra handling, launch supplies/effects, border, and Grace Period listeners.

  3. Add Maven metadata, plugin.yml, and configurable config.yml.

Implemented the ShineSMP start-event plugin for Paper 1.21.x, including the countdown, launch supplies and Levitation, temporary Elytra protections, configurable world border, Grace Period PvP protection, commands, and cleanup.

Install: Compile in Kodari (desktop: Compile in the top bar; phone: ⋮ → Compile Project), then download the successful build. Place the JAR in your server’s plugins folder and restart. Configure the event in plugins/ShineSMPStart/config.yml.

Use /ShineSmpStart on to start the event, /ShineSmpStart status to check it, and /ShineSmpStart reset to reset it. Start and reset require shinesmp.admin (default: OP); status uses shinesmp.status (default: everyone).

sykicgotqd

The compilation failed with this error:

code
Compilation failed with 2 error(s):

ERROR in src/main/java/com/shinesmp/startevent/StartEventListener.java at line 19: cannot find symbol
import org.bukkit.event.player.PlayerToggleGlideEvent;
                              ^
  symbol: class PlayerToggleGlideEvent
  location: package org.bukkit.event.player

ERROR in src/main/java/com/shinesmp/startevent/StartEventListener.java at line 42: cannot find symbol
    public void onGlide(PlayerToggleGlideEvent event) {
                        ^
  symbol: class PlayerToggleGlideEvent
  location: class StartEventListener


=== COMPILATION ERROR ANALYSIS ===

MISSING CLASSES:
  - PlayerToggleGlideEvent
ACTION: Create these classes or check imports

FILES TO INVESTIGATE:
  - src/main/java/com/shinesmp/startevent/StartEventListener.java

Please fix this error by creating a new artifact with the corrected code.

Kodari AI
KodariOct 17 at 11:03 am 1

Replaced the unavailable PlayerToggleGlideEvent with Bukkit’s EntityToggleGlideEvent and updated the handler to process player glide starts.

Compile the project in Kodari, then download the successful build to get the corrected JAR.

Kodari can make mistakes. Review important code before using.
Files
src
pom.xml
Code
7 810
src/main/java/com/shinesmp/startevent/ShineSMPPlugin.java
package com.shinesmp.startevent;

import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.Objects;

public final class ShineSMPPlugin extends JavaPlugin {
    private StartEventManager eventManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        eventManager = new StartEventManager(this);
        Bukkit.getPluginManager().registerEvents(new StartEventListener(eventManager), this);
        StartEventCommand commandExecutor = new StartEventCommand(eventManager);
        Objects.requireNonNull(getCommand("shinesmpstart")).setExecutor(commandExecutor);
        Objects.requireNonNull(getCommand("shinesmpstart")).setTabCompleter(commandExecutor);
    }

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