--- 📎 Attached 1 file(s):
File: pasted-code-1790770199850.txt
Create a Minecraft Java Edition plugin specifically compatible with Minecraft 1.21.11.
Add a custom craftable weapon called the Sky Mace.
1. Sky Mace — Base Weapon
The Sky Mace should behave like a normal Minecraft mace in combat.
Give it a unique name, lore, and appearance.
Make sure the plugin can distinguish the Sky Mace from a normal vanilla mace.
The Sky Mace must retain the normal mace's combat mechanics, including its smash-attack behavior.
2. Flight Ability
When the player right-clicks while holding the Sky Mace:
Activate the Sky Mace's flight ability.
Allow the player to fly for a configurable amount of time.
Make the flight speed configurable.
Prevent fall damage caused by the ability.
Add a configurable cooldown after the ability is used.
Display an action-bar message showing the remaining flight time and cooldown.
Make sure the ability cannot be bypassed by dropping, picking up, or switching the mace.
3. Area Stun Ability
Add a special stun ability connected to hitting another player or mob with the Sky Mace.
When the player successfully hits an entity with the Sky Mace:
Detect entities within a configurable radius around the target.
Apply a stun effect to nearby entities.
The stun should temporarily prevent affected entities from moving normally.
Make the stun duration configurable.
Make the stun radius configurable.
Make sure the attacker is not stunned by their own ability.
Do not permanently modify affected entities.
After the stun duration expires, affected entities should return to normal.
Add a configurable cooldown for the stun ability so it cannot be triggered constantly.
Show an appropriate particle/effect around the stunned entities.
Play a suitable sound when the stun activates.
4. Stun Restrictions
The stun should work on players and mobs.
Make the affected entities clearly identifiable while stunned.
Do not allow the ability to create permanent potion effects or permanent movement restrictions.
Handle players leaving, dying, or disconnecting while stunned without causing errors.
Prevent exploits involving repeatedly switching or dropping the mace.
5. Custom Crafting Recipe
Create a custom recipe for the Sky Mace using:
Top row: Nether Star | Netherite Ingot | Nether Star
Middle row: Diamond | Mace | Diamond
Bottom row: Air | Breeze Rod | Air
The recipe must produce exactly one Sky Mace.
6. Configuration
Create a configuration file with settings for:
Flight duration
Flight speed
Flight cooldown
Stun radius
Stun duration
Stun cooldown
Whether mobs can be stunned
Whether players can be stunned
Ability messages
Particle effects
Sounds
Sky Mace name and lore
Recipe ingredients
7. Minecraft Version
The plugin must target Minecraft Java Edition 1.21.11 and use the appropriate API for that version.
Do not use outdated APIs when a modern 1.21.11 API is available.
8. Plugin Quality
Generate all required plugin source files.
Include the plugin configuration file.
Include the correct plugin.yml or equivalent required metadata.
Make the project compile successfully.
Avoid deprecated or incompatible methods where possible.
Make the code organized and easy to modify.
Explain exactly how to compile and install the plugin on a Minecraft 1.21.11 server.
Do not require players to install a client-side mod.
Make all abilities server-side.
📄
pasted-code-1790770279667.txt
txt
86 lines
▶
Create a Minecraft Java Edition plugin specifically compatible with Minecraft 1.21.11.
Add a custom craftable weapon called the Sky Mace.
1. Sky Mace — Base Weapon
The Sky Mace should behave like a normal Minecraft mace in combat.
Give it a unique name, lore, and appearance.
Make sure the plugin can distinguish the Sky Mace from a normal vanilla mace.
The Sky Mace must retain the normal mace's combat mechanics, including its smash-attack behavior.
2. Flight Ability
When the player right-clicks while holding the Sky Mace:
Activate the Sky Mace's flight ability.
Allow the player to fly for a configurable amount of time.
Make the flight speed configurable.
Prevent fall damage caused by the ability.
Add a configurable cooldown after the ability is used.
Display an action-bar message showing the remaining flight time and cooldown.
Make sure the ability cannot be bypassed by dropping, picking up, or switching the mace.
3. Area Stun Ability
Add a special stun ability connected to hitting another player or mob with the Sky Mace.
When the player successfully hits an entity with the Sky Mace:
Detect entities within a configurable radius around the target.
Apply a stun effect to nearby entities.
The stun should temporarily prevent affected entities from moving normally.
Make the stun duration configurable.
Make the stun radius configurable.
Make sure the attacker is not stunned by their own ability.
Do not permanently modify affected entities.
After the stun duration expires, affected entities should return to normal.
Add a configurable cooldown for the stun ability so it cannot be triggered constantly.
Show an appropriate particle/effect around the stunned entities.
Play a suitable sound when the stun activates.
4. Stun Restrictions
The stun should work on players and mobs.
Make the affected entities clearly identifiable while stunned.
Do not allow the ability to create permanent potion effects or permanent movement restrictions.
Handle players leaving, dying, or disconnecting while stunned without causing errors.
Prevent exploits involving repeatedly switching or dropping the mace.
5. Custom Crafting Recipe
Create a custom recipe for the Sky Mace using:
Top row: Nether Star | Netherite Ingot | Nether Star
Middle row: Diamond | Mace | Diamond
Bottom row: Air | Breeze Rod | Air
The recipe must produce exactly one Sky Mace.
6. Configuration
Create a configuration file with settings for:
Flight duration
Flight speed
Flight cooldown
Stun radius
Stun duration
Stun cooldown
Whether mobs can be stunned
Whether players can be stunned
Ability messages
Particle effects
Sounds
Sky Mace name and lore
Recipe ingredients
7. Minecraft Version
The plugin must target Minecraft Java Edition 1.21.11 and use the appropriate API for that version.
Do not use outdated APIs when a modern 1.21.11 API is available.
8. Plugin Quality
Generate all required plugin source files.
Include the plugin configuration file.
Include the correct plugin.yml or equivalent required metadata.
Make the project compile successfully.
Avoid deprecated or incompatible methods where possible.
Make the code organized and easy to modify.
Explain exactly how to compile and install the plugin on a Minecraft 1.21.11 server.
Do not require players to install a client-side mod.
Make all abilities server-side.
Set up a Java 21 Paper project targeting 1.21.11.
Add the Sky Mace item, recipe, flight and stun abilities, and configurable settings.
Include plugin metadata and concise build/install steps.
Created the Sky Mace Paper plugin project for Minecraft 1.21.11. It uses a real mace item with a persistent identifier, so its normal combat and smash-attack behavior remain intact. The configured recipe produces one Sky Mace.
Flight and stun timers and cooldowns are tracked per player, independent of whether they switch, drop, or pick up the mace. Flight fall protection lasts until the player lands; stun restores affected entities’ previous AI and glowing state and cleans up on death, disconnect, or chunk unload.
Compile and install
Use Java 21 and Gradle.
From the project root, run
gradle clean build.Copy
build/libs/SkyMace-1.0.0.jarto the Paper 1.21.11 server’splugins/directory.Restart the server. Adjust ability settings, messages, item name and lore, and recipe ingredients in
plugins/SkyMace/config.yml.
XSeries is declared for compilation and loaded by Paper at runtime; players need no client-side mod.
package com.kodari.skymace;
import org.bukkit.Bukkit;
import org.bukkit.NamespacedKey;
import org.bukkit.plugin.java.JavaPlugin;
public final class SkyMacePlugin extends JavaPlugin {
private SkyMaceManager skyMaceManager;
@Override
public void onEnable() {
saveDefaultConfig();
skyMaceManager = new SkyMaceManager(this);
Bukkit.getPluginManager().registerEvents(skyMaceManager, this);
skyMaceManager.registerRecipe();
skyMaceManager.startTasks();
}
@Override
public void onDisable() {
if (skyMaceManager != null) {
skyMaceManager.shutdown();
}
}
NamespacedKey skyMaceKey() {
return new NamespacedKey(this, "sky_mace");
}
}