davideloo
๐Ÿ“Ž 1 file 3,267 chars
๐Ÿ“„
pasted-code-1780289030680.txt
txt 88 lines
โ–ถ
You are an expert Minecraft datapack/plugin developer. Create a fully functional custom Netherite Sword with the following exact specifications. Do not simplify, omit, or alter any requirements.

## Custom Weapon

* A custom Netherite Sword with a unique name and lore.
* The sword must be obtainable ONLY through commands by players with Operator (OP) permissions.
* It must not be craftable, obtainable through survival gameplay, loot tables, villagers, structures, or any other method.

## Special Ability: TNT Launcher

When a player right-clicks while holding the sword:

* Launch a TNT block projectile from the player's position.
* The projectile must move smoothly and naturally through the air like an arrow.
* It should visually appear as a flying/sliding TNT block.
* The movement must be fluid and professional-looking, not based on slow or obvious teleportation.
* The projectile travels in the direction the player is looking.
* The projectile has a maximum range of exactly **13 blocks**.
* Once the projectile reaches 13 blocks, it must immediately disappear.

## Direct Hit Effects

When the projectile hits a player or mob:

1. The TNT projectile immediately disappears.
2. A 2-second countdown begins.
3. After exactly 2 seconds:

   * A TNT explosion effect and sound play.
   * The explosion is cosmetic only.
   * No blocks are damaged, destroyed, moved, or modified.
   * No fire is created.
   * No terrain damage occurs.
4. The target receives exactly 2 TRUE HEARTS (4 health points) of damage.
5. This damage must completely bypass:

   * Armor
   * Armor Toughness
   * Protection Enchantments
   * Resistance Effects
   * Absorption
   * Shields
   * Any normal damage reduction mechanics
6. The damage must always remain exactly 2 true hearts regardless of equipment or status effects.

## Missed Shot Behavior

If the projectile does not hit a target before reaching its 13-block range:

* The projectile automatically disappears.
* No TNT block remains in the world.
* No explosion occurs.
* No entities remain behind.

## Cooldown System

* The ability has a 45-second cooldown.
* Cooldowns must be tracked separately for each player.
* Players cannot fire again until the cooldown expires.

### Action Bar Display

While the sword is held:

* Show the remaining cooldown in the Action Bar.
* Update the display in real time.
* Example:

  * "TNT Launcher Cooldown: 38s"
  * "TNT Launcher Cooldown: 12s"
* When ready:

  * Display "TNT Launcher Ready"

## Performance Requirements

* Must be multiplayer compatible.
* Must be optimized to minimize lag.
* Must properly clean up all temporary entities and data.
* No projectile, TNT block, marker, armor stand, or helper entity should remain after use.
* The system should be reliable and production-quality.

## Output Requirements

Provide the complete implementation with all required files, commands, functions, tags, and setup instructions. Return production-ready code with comments explaining important sections.

Also, adding **"exactly 13 blocks measured from the firing position, not 13 blocks after collisions or redirects"** helps prevent the AI from interpreting the range differently.
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code