sohammm_xd

Create a Minecraft Paper/Spigot plugin (Java, 1.21+) for an SMP server called "RIFT SMP" with a custom global event system.

Command System:

Main command:

/event rift <start|stop>

  1. Rift Event Control

/event rift start Starts the Rift Event immediately Default duration: 10 minutes If already running, send message: “Rift event is already active” /event rift stop Immediately ends the Rift Event Removes all effects and visuals Sends clean shutdown broadcast

  1. World Atmosphere (During Event)

When active:

Purple rift-themed sky effect (fog, potion visuals, night vision tricks) Continuous glowing purple particles around players/world Make environment feel unstable and chaotic

  1. Player Effects (All Online Players)

Applied during event:

Strength II Regeneration II Glowing effect (players visible through walls) Rules:

Apply to all online players Reapply to players who join mid-event Remove completely when event stops

  1. Golden Apple Buff (Custom Mechanic)

During event:

Golden Apple effects are 2× stronger or 2× longer Implement using PlayerItemConsumeEvent Must override default healing/buff logic safely

  1. Player Tracking System

Each player receives a compass Compass tracks nearest player Updates every 2–3 seconds Active only during Rift event

  1. Visual + Audio Effects

On Start:

Broadcast:

⚡ THE RIFT HAS OPENED ⚡ On Stop:

Broadcast:

✨ THE RIFT HAS CLOSED ✨ Play sounds:

Start: Ender Dragon roar / portal activation Optional ambient rift sounds during event

  1. Glowing System

All players glow during event Must be removed cleanly on stop Optional upgrade:

Use scoreboard teams for colored glow (purple theme)

  1. Event Cleanup (Important)

On /event rift stop:

Remove all potion effects Disable particle tasks Clear compass tracking system Stop all schedulers related to event Restore normal gameplay state Technical Requirements:

Minecraft 1.21+ Paper/Spigot plugin Clean OOP structure:

Main plugin class Command executor with subcommands Event listeners Scheduler system Optimized for multiplayer SMP (20+ players) No laggy loops or unsafe threads Config.yml:

Default event duration Particle density Effect strength Feature toggles (tracking, glow, particles, etc.) Bonus Features (Optional):

BossBar timer during event ActionBar countdown Random rift bursts (lightning or particle explosions) Modular system for future expansions (bosses, zones, etc.)

Kodari AI
KodariMay 5 at 12:51 pm 23,622 (v2)
RiftSMP
A custom global event plugin for the RIFT SMP server. Features the Rift Event: timed global combat event with Strength II, Regeneration II, and Glowing effects for all players, purple particle atmosphere, compass-based player tracking, doubled golden apple buffs, scoreboard team colored glow, BossBar countdown timer, ActionBar display, thunderstorm atmosphere, and full event cleanup. Managed via /event rift start|stop with fully configurable duration, particle density, and feature toggles.

Planning class dependencies before writing:

  • RiftSMP → holds ConfigManager + RiftEventManager

  • ConfigManager → reads config.yml

  • RiftEventManager → core logic: effects, tasks, bossbar, glow team, compass; exposes start(), stop(broadcast), isActive(), applyEffects(Player), removeEffects(Player), onPlayerJoin(Player)

  • EventCommand → calls getRiftEventManager()

  • RiftEventListener → listens to PlayerJoinEvent, PlayerItemConsumeEvent; calls manager methods

Here’s a summary of what was built:

Core Structure:

  • RiftSMP — main plugin class, wires everything together, calls stop(false) on disable for clean shutdown

  • ConfigManager — typed accessors for all config.yml keys

  • RiftEventManager — all event logic: effects, particle/compass/timer tasks, BossBar, scoreboard glow team, weather

  • EventCommand — /event rift start|stop with tab completion; permission riftsmp.event (OP by default)

  • RiftEventListener — handles mid-event player joins and golden apple consumption

Golden Apple mechanic: Doesn’t cancel the event (vanilla effects apply normally), then a 1-tick delayed task overrides the duration values to exactly 2× vanilla — clean and safe with no edge cases around item removal.

Glow system: Uses a scoreboard Team named rift_glow with DARK_PURPLE color applied via Adventure API — all players added on start, team unregistered on stop.

Rift bursts: Built into the particle task — each player has a ~2% chance per 10-tick cycle of triggering a REVERSE_PORTAL burst, with a 30% chance of a cosmetic lightning strike (strikeLightningEffect, no damage).

Cleanup guarantee: stop() cancels all tasks, clears BossBar, removes all 3 potion effects per player, removes compasses, unregisters the glow team, and restores clear weather — called from both the timer expiry and the /event rift stop command.

Kodari can make mistakes. Review important code before using.
Files
src
Code
7 523
src/main/java/com/riftsmp/RiftSMP.java
package com.riftsmp;

import com.riftsmp.commands.EventCommand;
import com.riftsmp.config.ConfigManager;
import com.riftsmp.event.RiftEventManager;
import com.riftsmp.listeners.RiftEventListener;
import org.bukkit.plugin.java.JavaPlugin;

public class RiftSMP extends JavaPlugin {

    private ConfigManager configManager;
    private RiftEventManager riftEventManager;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        this.configManager = new ConfigManager(this);
        this.riftEventManager = new RiftEventManager(this);

        getCommand("event").setExecutor(new EventCommand(this));
        getServer().getPluginManager().registerEvents(new RiftEventListener(this), this);

        getLogger().info("RiftSMP enabled.");
    }

    @Override
    public void onDisable() {
        if (riftEventManager != null && riftEventManager.isActive()) {
            riftEventManager.stop(false);
        }
    }

    public ConfigManager getCfg() {
        return configManager;
    }

    public RiftEventManager getRiftEventManager() {
        return riftEventManager;
    }
}