kyattenoff-arch

can you create a plugin that adds a god mace that launches you into the air when you press right click while holding it, that cannot be stored in a chest or an enderchest and can't br framed in an item frame, can you also add the enchantments, mending, unbreaking 3, density 5, breach 3, windburst 2, and fall damage negation but only after using the ability

Kodari AI
KodariMay 29 at 10:17 pm 5
GodMace
Adds a powerful God Mace item to Minecraft. Right-clicking launches the holder into the air with a dramatic upward velocity. The mace cannot be stored in chests, ender chests, or placed in item frames. Enchanted with Mending, Unbreaking III, Density V, Breach III, and Wind Burst II. Fall damage is negated only after using the launch ability, preventing cheese deaths from normal falls.

Planning class dependencies:

  • GodMace (main plugin) — registers events, commands, initializes GodMaceItem

  • GodMaceItem — builds the ItemStack with all enchantments

  • GodMaceListener — handles right-click launch, storage prevention, item frame prevention, fall damage negation

  • plugin.yml — registers /godmace give command

Key notes:

  • Right-click (air or block) with the mace in main hand launches you straight up with velocity 2.5 (configurable)

  • Fall damage negation is tracked per-UUID and only active after a launch — expires after 400 ticks (~20s) or on first fall impact

  • Storage prevention blocks placement into chests, barrels, shulker boxes, ender chests, dispensers, and droppers via InventoryClickEvent

  • Item frame prevention cancels HangingPlaceEvent when holding the mace

  • The mace is identified by a persistent NBT tag (god_mace) so it survives server restarts and item transfers

  • Requires 1.21+ for the MACE material and Density/Breach/Wind Burst enchantments — use /godmace [player] to give it

Kodari can make mistakes. Review important code before using.
Files
src
Code
6 250
src/main/java/com/kodari/godmace/GodMace.java
package com.kodari.godmace;

import org.bukkit.plugin.java.JavaPlugin;

public class GodMace extends JavaPlugin {

    private GodMaceItem godMaceItem;

    @Override
    public void onEnable() {
        godMaceItem = new GodMaceItem();
        getServer().getPluginManager().registerEvents(new GodMaceListener(this), this);
        getCommand("godmace").setExecutor(new GodMaceCommand(this));
    }

    public GodMaceItem getGodMaceItem() {
        return godMaceItem;
    }
}