rexzeo
📎 1 file 4,548 chars
📄
pasted-code-1781510494231.txt
txt 244 lines
▶
Create a COMPLETE Minecraft Paper 1.20.2 plugin in Java 17 called "GodSword".

IMPORTANT:

* Target Server: Paper 1.20.2
* Java Version: 17
* Generate FULL source code.
* Generate plugin.yml.
* Generate all classes.
* No pseudocode.
* No TODO comments.
* Code must compile successfully on Paper 1.20.2.

=========================================
PLUGIN CONCEPT
==============

A command spawns a giant magical sword stuck in the ground. Players can click it to claim a powerful God Sword with special abilities.

=========================================
COMMAND
=======

Command:

/displaysword

When executed:

* Spawn an ItemDisplay entity.
* Display item = WOODEN_SWORD.
* Scale = 2.5x.
* Rotate it perfectly vertical.
* Sword tip points downward.
* Make it appear embedded inside the block.

=========================================
INTERACTION SYSTEM
==================

Spawn an invisible Interaction entity above the sword.

Requirements:

* Detect right-clicks.
* Proper hitbox size.
* Linked to the sword display.
* Store references using UUIDs.

=========================================
AMBIENT PARTICLES
=================

Start a repeating BukkitRunnable.

Continuously create:

* REDSTONE particles
* Pure red color
* Circular orbit around sword
* Smooth animation

Particles must stop when sword is claimed.

=========================================
CLAIM SYSTEM
============

When a player right-clicks the Interaction entity:

* Play ITEM_TOTEM_USE sound.
* Spawn Totem particles.
* Cancel particle task.
* Remove ItemDisplay.
* Remove Interaction entity.
* Give player God Sword.
* Prevent duplicate claims.

=========================================
GOD SWORD ITEM
==============

Material:
WOODEN_SWORD

Name:
§6§lGod Sword

Lore:
§7A legendary weapon
§7Blessed by ancient gods
§7Grants extended reach
§7Contains smash powers
§7Can dash through enemies

Make item:

* Unbreakable
* Hide attributes
* Hide enchantments

Unsafe Enchantments:

* Sharpness 6
* Unbreaking 100
* Wind Burst 1
* Density 5

=========================================
VERY IMPORTANT PAPER 1.20.2 RULES
=================================

DO NOT USE:

* EquipmentSlotGroup
* Attribute.GENERIC_ENTITY_INTERACTION_RANGE
* Attribute.GENERIC_BLOCK_INTERACTION_RANGE

These APIs do not exist in Paper 1.20.2.

Use:

* EquipmentSlot.HAND

only.

=========================================
CUSTOM REACH ABILITY
====================

God Sword grants +4 blocks reach.

DO NOT USE ATTRIBUTES.

Implement manually.

Requirements:

* Detect attack while holding God Sword.
* Use Paper ray tracing.
* Check entities up to 7 blocks away.
* Verify line of sight.
* Ignore entities behind walls.
* Prevent abuse and duplicate hits.

=========================================
MACE SMASH ABILITY
==================

When player attacks while falling:

Condition:

player.getFallDistance() > 0

Then:

* Calculate bonus damage based on fall distance.
* Apply extra damage.
* Spawn impact particles.
* Play powerful smash sound.
* Reset fall distance.

Example:

bonusDamage = fallDistance × 1.5

After attack:

player.setFallDistance(0);

This prevents fall damage.

=========================================
DASH ABILITY
============

Activation:

SHIFT + RIGHT CLICK

while holding God Sword.

Requirements:

* Launch player forward.
* Use player's facing direction.
* Strong velocity boost.
* Play Wind Charge sounds.
* Spawn particles behind player.
* Cooldown = 3 seconds.

Cooldown:

* Per player.
* UUID based.
* HashMap storage.

If cooldown active:

Display remaining cooldown time.

=========================================
DASH PARTICLES
==============

During dash:

Create a trail effect.

Requirements:

* Particles appear BEHIND player.
* Never appear in front of player.
* Use red particles.
* Make trail look magical and powerful.

=========================================
PROJECT STRUCTURE
=================

Generate:

GodSwordPlugin.java
DisplaySwordManager.java
DisplaySwordCommand.java
ParticleTask.java
GodSwordFactory.java
SwordClaimListener.java
CombatListener.java
DashListener.java
plugin.yml

=========================================
FINAL OUTPUT
============

Return COMPLETE code for every file.

Do not summarize.

Do not explain.

Output every file separately with file names and full contents.
Kodari can make mistakes. Review important code before using.
Files

No files in this session

Code