apex.ly
📎 1 file 3,207 chars
📄
pasted-code-1790380199015.txt
txt 93 lines
▶
Plugin Name: StrangeSMPRituals
Description

A custom Minecraft plugin designed for ritual crafting events. Admins hold an item in hand to initiate a server-wide ritual at their current location. The ritual features levitating items, custom particle circles, boss bar progress, periodic chat broadcasts, and a GUI editor matching the provided reference image.
Commands & Permissions

Permission: strangesmp.admin (OP Only)

    /strangesmp:ritual start time/

        Usage Examples: /strangesmp:ritual start time/10m or /strangesmp:ritual start time/10s

        Mechanism:

            Takes the item currently held in the admin's main hand to be the target ritual item.

            Starts the ritual at the player's exact location.

            Consumes or spawns an floating instance of the item at the location.

    /strangesmp:ritual stop

        Stops the currently active ritual immediately and cleans up entity displays, particle effects, and boss bars.

    /strangesmp:ritualsettings

        Opens the Configuration GUI.

GUI Configuration Interface (/strangesmp:ritualsettings)

Design a 54-slot Chest GUI based on the reference layout:

    Header Item (Top Left / Display Item):

        Title: §e§lRITUALS

        Lore:

            §fCOLOR: §c

            §fDURATION: §a

            §fRADIUS: §a

            §7§l▌▌ EDIT RITUAL ITEMS

            §7§l▌▌ RITUAL SETTINGS

    Interactive GUI Options:

        Color Picker: Toggle particle circle colors (Red, Purple, Cyan, Gold, Green).

        Radius Adjuster: Clickable buttons (+1 / -1 block) to modify the particle circle radius (Default: 10.0).

        Duration Preset Adjuster: Set default duration presets (e.g., 10m, 10s).

        Edit Ritual Items: Sub-menu to define required ingredient items for ritual completion if configured.

Ritual Visuals & Mechanics

    Floating Item Display & Hologram Timer:

        At the center of the ritual location, spawn an ItemDisplay or invisible Armor Stand holding the ritual item.

        The item continuously rotates and gently bobs up and down.

        A dynamic hologram display directly above the floating item shows the remaining time formatted as §e§lRITUAL ACTIVE §f- §aMM:SS.

    Particle Boundary Circle:

        Spawn a continuous particle circle on the ground level using the configured color and radius (e.g., Redstone dust particles with matching RGB values).

    BossBar Tracking:

        Display a server-wide (or range-based) BossBar showing:

            Title: §d§lRitual at X:  Y:  Z:  §7| §eTime Left: 

            Progress: Decreases smoothly from 100% to 0% as time expires.

    Chat Notifications:

        Broadcast a chat message every 1 minute to all online players:

            §8[§d§lStrangeSMP§8] §fA ritual for §e §fis active at §aX:  Y:  Z: §f! Remaining: §e

    Completion & Stop Events:

        When time reaches 00:00 or /strangesmp:ritual stop is executed:

            Remove the floating item entity, hologram timer, particle task, and BossBar.

            Broadcast completion chat message and drop/reward the item at the center.
Kodari AI
KodariSep 25 at 11:51 pm 1
StrangeSMPRituals
A server-wide ritual crafting plugin where admins hold an item to initiate a timed ritual at their location. Features a rotating floating ItemDisplay with hologram countdown, colored particle boundary circles, animated BossBar progress tracking, periodic chat broadcasts, and a 54-slot configuration GUI for adjusting particle colors, radius, duration presets, and ritual ingredient items. Includes start/stop commands with permission-gated admin access.
  1. Set up the Paper plugin, commands, and default configuration.

  2. Implement ritual visuals, timer, broadcasts, boss bar, and cleanup.

  3. Add the settings GUI for colors, radius, duration presets, and required items.

Created StrangeSMPRituals with configurable ritual visuals, timer and boss bar, admin commands, and a settings GUI for particle color, radius, duration presets, and required items. Use /ritual start [time/<duration>], /ritual stop, and /ritualsettings; starting without a duration uses the GUI’s default preset. Required items and the held ritual item are consumed at start, and the ritual item drops at the ritual site when it ends.

apex.ly

make it like after rituals end it will summon lighting bolt and then drop the item

Kodari AI
KodariSep 25 at 11:58 pm 1

Rituals now summon a lightning bolt at the ritual location before dropping the item.

apex.ly

it distoryes the itemm with lighting fix it do like thunderbold then item drop after 2 seconds

Kodari AI
KodariSep 26 at 12:07 am 1

Changed the ritual’s lightning to a cosmetic bolt, so it won’t damage or destroy the item. The item now drops at the ritual location 2 seconds later.

apex.ly

can you do like when ritual start it will show a line like beacon line in any color i want like add line and settings of this

Kodari AI
KodariSep 26 at 1:21 am 1

Plan:

  1. Add a vertical, configurable dust-particle beacon line to the ritual.

  2. Add GUI controls for enabling it, setting its height, and choosing any RGB color.

  3. Persist the new settings in config.yml.

Added a vertical beacon-style particle line during rituals. In /ritualsettings, open Beacon line settings to toggle it, adjust its height, and set any RGB color from 0–255 per channel. Defaults are enabled, 32 blocks high, and purple.

apex.ly

i want you to make a temple like when ritual start paste a temple like a aesthetic small 10 block or less temple and in the middle on block theirs the item that is being ritualed

Kodari AI
KodariSep 26 at 1:31 am 1
  1. Build a compact 7×7 stone shrine with corner pillars and a distinct center pedestal when the ritual starts.

  2. Keep the item displayed above that center block and restore the original blocks when the ritual stops or completes.

Added a compact 7×7 shrine with corner pillars, a roof border, and a center pedestal beneath the ritual item. Original blocks are restored when the ritual ends or is stopped.

apex.ly

can you do like this? and the item will move

1 image attached
Kodari AI
KodariSep 26 at 1:36 am 1
  1. Replace the blocky shrine with a compact, layered stone pedestal inspired by the reference.

  2. Raise the floating item above the pedestal and make its spin visible while it gently bobs.

Updated the ritual structure to a compact, dark-stone pedestal with a carved cap and decorative accents. The item now floats above it, visibly rotates, and gently bobs; the hologram moves up to stay above the item.

apex.ly

display 1 block above its glitched

1 image attached
Kodari AI
KodariSep 26 at 1:38 am 1
  1. Raise the floating item by one block above the temple.

  2. Move its hologram up by the same amount to keep the spacing consistent.

Raised the ritual item display by one block and moved the hologram up by the same amount to preserve its spacing.

apex.ly

can you do like wither sound when ritual start

Kodari AI
KodariSep 26 at 3:37 am 1

Added the wither spawn sound when a ritual starts; it plays for the player who starts it.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
settings.gradle
Code
8 852
src/main/java/dev/strangesmp/rituals/StrangeSMPRituals.java
package dev.strangesmp.rituals;

import com.cryptomorin.xseries.XMaterial;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import dev.strangesmp.rituals.gui.RitualSettingsGUI;
import dev.strangesmp.rituals.gui.RitualSettingsListener;
import dev.strangesmp.rituals.ritual.RitualManager;

import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

public final class StrangeSMPRituals extends JavaPlugin implements CommandExecutor, TabCompleter {
    private static final String PREFIX = ChatColor.DARK_GRAY + "[" + ChatColor.LIGHT_PURPLE + "StrangeSMP" + ChatColor.DARK_GRAY + "] ";

    private RitualManager ritualManager;
    private RitualSettingsGUI settingsGUI;

    @Override
    public void onEnable() {
        saveDefaultConfig();
        ritualManager = new RitualManager(this);
        settingsGUI = new RitualSettingsGUI(this);
        getServer().getPluginManager().registerEvents(ritualManager, this);
        getServer().getPluginManager().registerEvents(new RitualSettingsListener(settingsGUI), this);

        getCommand("ritual").setExecutor(this);
        getCommand("ritual").setTabCompleter(this);
        getCommand("ritualsettings").setExecutor(this);
    }

    @Override
    public void onDisable() {
        if (ritualManager != null) {
            ritualManager.stop(true);
        }
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (!sender.hasPermission("strangesmp.admin")) {
            sender.sendMessage(PREFIX + ChatColor.RED + "You do not have permission to do that.");
            return true;
        }

        if (command.getName().equalsIgnoreCase("ritualsettings")) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage(PREFIX + ChatColor.RED + "Only players can open the settings menu.");
                return true;
            }
            settingsGUI.openMain(player);
            return true;
        }

        if (args.length == 1 && args[0].equalsIgnoreCase("stop")) {
            if (!ritualManager.isActive()) {
                sender.sendMessage(PREFIX + ChatColor.RED + "There is no active ritual.");
                return true;
            }
            ritualManager.stop(true);
            return true;
        }

        if (args.length == 1 && args[0].equalsIgnoreCase("start")) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage(PREFIX + ChatColor.RED + "Only players can start a ritual.");
                return true;
            }
            String configuredDuration = getConfig().getString("ritual.default-duration", "10m");
            Long durationSeconds = configuredDuration == null ? null : parseDuration(configuredDuration);
            if (durationSeconds == null) {
                sender.sendMessage(PREFIX + ChatColor.RED + "The configured default duration is invalid. Set it in /ritualsettings.");
                return true;
            }
            ritualManager.start(player, durationSeconds);
            return true;
        }

        if (args.length == 2 && args[0].equalsIgnoreCase("start") && args[1].toLowerCase(Locale.ROOT).startsWith("time/")) {
            if (!(sender instanceof Player player)) {
                sender.sendMessage(PREFIX + ChatColor.RED + "Only players can start a ritual.");
                return true;
            }
            Long durationSeconds = parseDuration(args[1].substring("time/".length()));
            if (durationSeconds == null) {
                sender.sendMessage(PREFIX + ChatColor.RED + "Use a duration such as 10s, 5m, or 1h.");
                return true;
            }
            ritualManager.start(player, durationSeconds);
            return true;
        }

        sender.sendMessage(PREFIX + ChatColor.YELLOW + "Usage: /ritual start [time/<duration>] or /ritual stop");
        return true;
    }

    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String alias, String[] args) {
        if (command.getName().equalsIgnoreCase("ritualsettings")) {
            return List.of();
        }
        if (args.length == 1) {
            return List.of("start", "stop").stream()
                    .filter(value -> value.startsWith(args[0].toLowerCase(Locale.ROOT)))
                    .toList();
        }
        if (args.length == 2 && args[0].equalsIgnoreCase("start")) {
            return List.of("time/10m", "time/10s").stream()
                    .filter(value -> value.startsWith(args[1].toLowerCase(Locale.ROOT)))
                    .toList();
        }
        return new ArrayList<>();
    }

    private Long parseDuration(String input) {
        if (input.length() < 2) {
            return null;
        }
        char unit = Character.toLowerCase(input.charAt(input.length() - 1));
        long multiplier = switch (unit) {
            case 's' -> 1L;
            case 'm' -> 60L;
            case 'h' -> 3600L;
            default -> 0L;
        };
        if (multiplier == 0L) {
            return null;
        }
        try {
            long amount = Long.parseLong(input.substring(0, input.length() - 1));
            if (amount < 1 || amount > Long.MAX_VALUE / multiplier) {
                return null;
            }
            return amount * multiplier;
        } catch (NumberFormatException exception) {
            return null;
        }
    }

    public static String prefix() {
        return PREFIX;
    }
}