Aditya Partap Verma
📎 1 file 7,166 chars
📄
pasted-code-1794140265522.txt
txt 220 lines
▶
Create a Minecraft Speed SMP Plugin

Act as an experienced Minecraft Paper plugin developer. Create a complete, working Minecraft Java plugin called SpeedSMP.

1. Platform and compatibility

* Minecraft Java Edition: 1.21.11
* Server software: Paper 1.21.11
* Java: 21
* Build system: Gradle
* Output: A compiled, installable .jar file.
* Use the Paper API and avoid unnecessary dependencies.
* Save player data persistently so it survives server restarts.

2. Custom items

There must be exactly two custom items:

1. Ability Roll
2. Speed

Give each item a custom name, lore, unique identifier and custom resource-pack model.

Do not create extra custom items.

3. Speed system

Speed is a permanent player stat, not a potion effect.

There are six levels:

Level	Movement speed bonus
0	0%
1	+4%
2	+8%
3	+12%
4	+16%
5	+20%

Requirements:

* Speed affects both walking and sprinting.
* Apply the bonus using a safe attribute modifier that does not overwrite unrelated player attributes.
* The stat must persist through death, logout and server restart, except for the specified death penalty.
* Display the player’s Speed level in a useful way, such as their action bar.

Gaining Speed

* Right-click a Speed item to consume it and gain one Speed level.
* Maximum level is 5.
* At level 5, players cannot consume additional Speed items, but can still collect, store and trade them.
* Speed items must be craftable.

Losing Speed

* When a player dies in PvP, they lose one Speed level, down to a minimum of zero.
* The defeated player drops one Speed item for the killer to collect.
* Do not make players lose more than one level per death.

4. Speed item crafting recipe

Use this exact 3×3 crafting layout:

Gold Block	Netherite Ingot	Gold Block
Netherite Ingot	Nether Star	Netherite Ingot
Gold Block	Netherite Ingot	Gold Block

The result is one Speed item.

5. Ability Roll

Players can craft an Ability Roll using this exact layout:

Book	Emerald	Book
Nether Quartz	Diamond	Nether Quartz
Book	Emerald	Book

Using an Ability Roll randomly grants one of four abilities:

* Sword ability: 25%
* Axe ability: 25%
* Bow ability: 25%
* Mace ability: 25%

Rules:

* Every ability has an equal 25% chance.
* A player can have only one active ability at a time.
* Using another Ability Roll replaces the current ability with the newly rolled ability.
* Abilities do not disappear when players die, log out or the server restarts.
* Players may store Ability Rolls even if they already have an ability.
* Consume the Ability Roll when successfully used.
* Store ability ownership persistently.

6. Sword ability

The Sword ability works with swords.

Requirements:

* Track consecutive successful hits against other players.
* After three consecutive hits, activate enhanced critical damage on subsequent sword hits.
* Enhanced damage must be 1.25 times normal sword damage.
* This damage must be stronger than a normal hit but weaker than a vanilla critical hit.
* Do not require jumping.
* Reset the hit counter when the attacker hits someone using a Wind Charge.
* Reset the hit counter when the attacker switches to another hotbar slot.
* The counter belongs to the attacker, not the victim.
* Keep the hit counter separate from cooldown systems.

7. Axe ability

The Axe ability works with axes.

Requirements:

* Cooldown: 30 seconds.
* The next successful axe hit activates the ability.
* The victim is stunned for approximately 2.5 seconds.
* While stunned, the victim cannot move or use items.
* Show the victim a clear visual or action-bar indication that they are stunned.
* The cooldown belongs to the player and continues in the background.

8. Bow ability

The Bow ability works with bows.

Requirements:

* Cooldown: 30 seconds.
* The next successful arrow hit activates the ability.
* The arrow should bypass armor protection.
* The ability hit deals a maximum of 4.5 hearts (9 health points).
* Ensure the ability replaces the normal arrow damage rather than adding extra damage on top.
* Prevent damage from exceeding the specified maximum.
* The cooldown belongs to the player and continues in the background.

9. Mace ability

The Mace ability works with maces.

Requirements:

* Cooldown: 30 seconds.
* Right-clicking a mace activates the ability.
* Temporarily apply:
    * Wind Burst I
    * Density V
    * Unbreaking III
* The enchantments last for 10 seconds.
* After 10 seconds, remove the temporary enchantments.
* Make sure the temporary enchantments cannot be permanently kept by dropping, moving or storing the mace.
* Only the player who owns the Mace ability can activate it.
* The cooldown continues in the background.

10. TNT minecart damage

TNT minecart explosions must deal 50% of their normal explosion damage to players.

Do not accidentally reduce ordinary TNT explosion damage unless specifically required.

11. Ability and cooldown persistence

* Save player abilities, Speed levels and cooldown timestamps.
* Data must survive server restarts.
* Cooldowns must continue counting down while players are offline.
* Switching weapons must not reset cooldowns.
* Display cooldown information clearly when a player tries to use an ability that is still on cooldown.

12. Resource pack

Create a compatible Minecraft 1.21.11 resource pack.

* Ability Roll texture: use a book-style icon.
* Speed texture: use a bottle-style icon with blue liquid.
* Preserve the existing visual design of the supplied item references.
* Use unique custom item model identifiers.
* Include a valid pack.mcmeta for Minecraft 1.21.11.
* Include all required texture and model files.
* Provide the resource pack as a separate ZIP.

13. Commands

Add simple administrative commands:

* /speedsmp reload — reload configuration.
* /speedsmp give speed   — give Speed items.
* /speedsmp give roll   — give Ability Rolls.
* /speedsmp info  — show a player’s Speed level and ability.

Restrict administrative commands to operators or users with the appropriate permission.

14. Code quality and reliability

* Use clean, organized Java code.
* Separate item creation, recipes, abilities, player data, cooldowns and commands into appropriate classes.
* Use UUIDs to identify players.
* Use unique item identifiers so renamed ordinary items cannot imitate custom items.
* Prevent item duplication exploits.
* Handle player disconnects and server shutdown safely.
* Avoid memory leaks and excessive repeating tasks.
* Validate all event handlers.
* Make sure the plugin does not interfere with unrelated Minecraft mechanics.
* Include useful error messages and console logging.

15. Deliverables

Provide:

1. Complete Java source code.
2. Gradle build files.
3. plugin.yml.
4. Configuration files.
5. A compiled and tested SpeedSMP.jar.
6. The Speed SMP resource pack ZIP.
7. Installation instructions.
8. A list of commands and permissions.
9. A clear explanation of any limitations.

Important: Do not provide pseudocode, incomplete classes, placeholder methods or pretend that the plugin has compiled. Build against the actual Paper 1.21.11 API, fix compilation errors, and test the plugin before calling it complete.
Kodari AI
KodariNov 8 at 12:19 pm 2
SpeedSMP
A Minecraft Paper plugin implementing a persistent speed progression system with six levels, two custom items (Speed and Ability Roll), and four combat abilities. Speed items grant permanent movement bonuses up to +20%, craftable via specific recipes. Ability Rolls randomly grant Sword, Axe, Bow, or Mace abilities with unique mechanics including combo tracking, stun effects, armor-piercing arrows, and temporary enchantments. Features persistent player data, offline cooldown tracking, TNT minecart damage reduction, admin commands, and a custom resource pack with unique item models.

Kodari can build the Paper plugin, but it cannot create the requested resource pack or ZIP.

Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code