📄
pasted-code-1791003145948.txt
txt
824 lines
▶
Create a completely NEW Minecraft Paper plugin project from scratch.
I have lost my previous project, so assume **NO previous files exist**. Create every file from the beginning.
The plugin should feel like a **premium Mythic Custom Weapons & Armor plugin** for a Minecraft SMP.
I am a beginner, so keep the Java code organized and understandable, but make the in-game effects polished, cinematic, and optimized.
# PLATFORM
* Minecraft: **Paper 1.21.11**
* Java: **21**
* Build system: **Maven**
* Plugin name: **CosmicWeapons**
* Main package: `com.kodari.cosmicweapons`
* Do NOT use XSeries.
* Use modern Paper/Bukkit APIs compatible with Paper 1.21.11.
---
# ⚔️ WEAPON 1 — COSMIC BLADE
Command:
`/custom 1`
Give exactly 1 Cosmic Blade directly into the player's inventory.
If inventory is full, safely drop the item at the player's location.
Material:
`NETHERITE_SWORD`
Name:
`&d&l⚔ COSMIC BLADE ⚔`
Enchantments:
* Sharpness IX
* Unbreaking III
CustomModelData:
`10001`
Use PersistentDataContainer to uniquely identify the weapon.
Normal Netherite Swords must NOT trigger Cosmic Blade abilities.
## Cosmic Blade Lore
Make the inventory tooltip look premium:
`&5━━━━━━━━━━━━━━━━`
`&d&l⚔ COSMIC BLADE ⚔`
`&5━━━━━━━━━━━━━━━━`
`&7Type: &dLegendary Sword`
`&7Sharpness: &fIX`
`&d✦ COSMIC RIFT`
`&7Right Click`
`&7Creates a cosmic explosion`
`&b✦ SONIC BOOM`
`&7Shift + Right Click`
`&7Massive forward shockwave`
`&a✦ VOID DASH`
`&7Shift + T`
`&7Dash through space`
`&5━━━━━━━━━━━━━━━━`
---
# 🌌 COSMIC RIFT
Activation:
**Right Click**
Create a cinematic cosmic attack.
Sequence:
1. Small particle circle around the player.
2. Particles spiral upward.
3. Short charging animation.
4. Cosmic portal effect.
5. Large particle explosion.
6. Play dramatic cosmic/portal sound.
7. Damage nearby enemies.
8. Strong but configurable knockback.
9. Never damage the user.
10. Never destroy blocks.
11. Never create permanent fire.
Use particles such as:
* END_ROD
* PORTAL
* REVERSE_PORTAL
* SOUL_FIRE_FLAME
* EXPLOSION
Make it visually impressive but optimized.
Configurable:
* damage
* radius
* cooldown
* knockback
* particle amount
Action bar:
`&d&l✦ COSMIC RIFT ACTIVATED ✦`
---
# 💥 SONIC BOOM
Activation:
**Shift + Right Click**
IMPORTANT:
Do NOT use the physical T key for Sonic Boom.
When holding the Cosmic Blade and sneaking:
`Shift + Right Click`
→ activate Sonic Boom.
Normal Right Click must ONLY activate Cosmic Rift.
Sonic Boom:
* Create a powerful forward shockwave.
* Create expanding particle rings.
* Use blue/white/sonic-style particles.
* Play a strong sonic boom sound.
* Damage enemies in front of the player.
* Knock enemies backward.
* Never damage the user.
* Configurable damage.
* Configurable range.
* Configurable width.
* Configurable cooldown.
Action bar:
`&b&l⚡ SONIC BOOM ⚡`
Make sure Cosmic Rift and Sonic Boom cannot trigger simultaneously.
---
# 🌀 VOID DASH
Activation:
**Shift + T**
IMPORTANT:
A normal Paper/Bukkit plugin cannot directly detect the physical keyboard T key through a normal Bukkit event.
Do NOT create fake code pretending it can.
If true T-key detection requires a client-side solution, explain the limitation and use the safest reliable method available.
The Dash itself must be VERY SMOOTH.
It should feel like a premium teleport/space dash, NOT a laggy teleport.
When activated:
1. Small portal effect at starting position.
2. Smooth fast forward movement.
3. Lightweight particle trail.
4. Portal effect at destination.
5. Play teleport/portal sound.
6. Preserve player's facing direction.
7. Do not move through solid blocks.
8. Avoid lava and dangerous locations where possible.
9. Avoid excessive teleport packets.
10. Avoid heavy calculations every tick.
11. Avoid excessive particles.
12. Prevent rubber-banding as much as reasonably possible.
Configurable:
* distance
* speed
* duration
* cooldown
* particle amount
---
# 🔨 WEAPON 2 — THUNDER MACE
Command:
`/custom 2`
Give exactly 1 Thunder Mace.
If inventory is full, safely drop it.
Material:
`MACE`
Name:
`&6&l⚡ THUNDER MACE ⚡`
CustomModelData:
`10002`
PersistentDataContainer ID:
`thunder_mace`
Enchantments:
* Density VII
* Breach VII
* Wind Burst V
* Unbreaking III
* Mending
Use the correct modern Paper 1.21.11 API.
---
# ⚡ THUNDER MACE LORE
Make it premium:
`&6━━━━━━━━━━━━━━━━`
`&6&l⚡ THUNDER MACE ⚡`
`&6━━━━━━━━━━━━━━━━`
`&7Type: &6Mythic Weapon`
`&6✦ THUNDER STRIKE`
`&7Right Click`
`&7Calls thunder from the sky`
`&b✦ EARTH SHATTER`
`&7Shift + Right Click`
`&7Smashes the ground`
`&e✦ STORM IMPACT`
`&7Attack enemies to trigger lightning`
`&7Density: &fVII`
`&7Breach: &fVII`
`&7Wind Burst: &fV`
`&6━━━━━━━━━━━━━━━━`
---
# 🌩️ THUNDER STRIKE
Activation:
**Right Click**
Create a cinematic thunder attack:
* Electric particles around player.
* Target area particle marker.
* Short charging effect.
* Lightning visual effect.
* Large impact ring.
* Explosion particles.
* Thunder sound.
* Damage nearby enemies.
* Strong knockback.
* Never damage user.
* Never break blocks.
* Never create permanent fire.
Use safe visual lightning whenever possible.
Configurable:
* damage
* radius
* cooldown
* knockback
---
# 🌍 EARTH SHATTER
Activation:
**Shift + Right Click**
Create:
* Ground impact effect.
* Expanding circular shockwave.
* Multiple particle rings.
* Block/debris particles.
* Explosion particles.
* Strong knockback.
* Damage nearby enemies.
* Heavy impact sound.
* Never actually break blocks.
Configurable:
* damage
* radius
* knockback
* cooldown
---
# 🌪️ WIND BURST CUSTOM EFFECT
The Thunder Mace has:
**Wind Burst V**
When the player hits another player or living entity with the Thunder Mace:
* The TARGET must be launched upward.
* Do NOT launch the attacker.
* Launch should feel powerful.
* Also push the target slightly away from the attacker.
* Add wind/cloud particles around the target.
* Play a wind burst sound.
* Make launch strength configurable.
Example config:
`wind-burst:`
` enabled: true`
` victim-launch-strength: 2.5`
` forward-strength: 0.4`
Keep the actual Minecraft Wind Burst V enchantment.
---
# ⚡ STORM IMPACT
When Thunder Mace successfully hits an enemy:
* Electric particles around target.
* Small lightning visual.
* Short thunder/electric sound.
* Configurable bonus damage.
* Configurable chance for stronger effect.
Do not break blocks.
---
# 🛡️ ARMOR SET — FROSTFIRE AEGIS
Create a complete custom armor set.
Name:
**Frostfire Aegis**
Use PersistentDataContainer IDs for every piece.
---
## 🪖 HELMET
Material:
`NETHERITE_HELMET`
Name:
`&b&l❄ FROSTFIRE AEGIS HELMET ❄`
Enchantments:
* Protection IX
* Unbreaking IX
* Mending
CustomModelData:
`20001`
While equipped:
**Night Vision**
Unlimited while equipped.
When removed:
→ Remove only the custom Night Vision effect.
---
## 🧥 CHESTPLATE
Material:
`NETHERITE_CHESTPLATE`
Name:
`&c&l🔥 FROSTFIRE AEGIS CHESTPLATE 🔥`
Enchantments:
* Protection IX
* Unbreaking IX
* Mending
CustomModelData:
`20002`
While equipped:
**Maximum Health = 30 HP / 15 hearts**
When removed:
→ Restore normal maximum health.
Do NOT stack attribute modifiers.
---
## 👖 LEGGINGS
Material:
`NETHERITE_LEGGINGS`
Name:
`&5&l✦ FROSTFIRE AEGIS LEGGINGS ✦`
Enchantments:
* Protection IX
* Unbreaking IX
* Mending
CustomModelData:
`20003`
While equipped:
**Jump Boost III**
Unlimited while equipped.
---
## 👢 BOOTS
Material:
`NETHERITE_BOOTS`
Name:
`&a&l⚡ FROSTFIRE AEGIS BOOTS ⚡`
Enchantments:
* Protection IX
* Unbreaking IX
* Mending
CustomModelData:
`20004`
While equipped:
**Speed III**
Unlimited while equipped.
---
# ❄️🔥 FROSTFIRE REVENGE
When another player attacks someone wearing any Frostfire Aegis piece:
Use an internal **10-second cooldown per armor wearer**.
After the cooldown is ready, the next valid attack triggers ONE random effect on the ATTACKER:
### ❄️ ICE
* Slowness
* 5 seconds
* Ice/frost particles
* Cold sound
### 🔥 FIRE
* Set attacker on fire
* Configurable duration
* Flame particles
* Fire sound
### 👁️ BLINDNESS
* Blindness
* 5 seconds
* Dark particles
* Appropriate sound
The effect must target the attacker, NOT the armor wearer.
---
# ✨ FULL SET BONUS
When all four Frostfire Aegis pieces are equipped:
* Subtle ice particles.
* Subtle flame particles.
* Occasional visual aura.
* No excessive particle spam.
Action bar:
`&b❄ &c&lFROSTFIRE AEGIS &b❄`
Removing any piece disables the full-set bonus.
---
# 📦 ARMOR COMMAND
Create:
`/customarmor 1`
This gives the COMPLETE Frostfire Aegis set directly into the player's inventory:
* Helmet
* Chestplate
* Leggings
* Boots
If there is not enough inventory space:
→ Safely drop remaining pieces at the player's location.
Permission:
`cosmicweapons.give`
Console cannot receive armor.
---
# 🎨 CUSTOM RESOURCE PACK
Create a SEPARATE resource-pack project for ALL custom weapons and armor.
Resource pack target:
**Minecraft 1.21.11**
Use the correct modern 1.21.11 item model/item definition system.
Do NOT use outdated resource-pack instructions.
## Weapon textures
Cosmic Blade:
`10001`
`cosmic_blade.png`
Thunder Mace:
`10002`
`thunder_mace.png`
## Armor textures
Helmet:
`20001`
`frostfire_helmet.png`
Chestplate:
`20002`
`frostfire_chestplate.png`
Leggings:
`20003`
`frostfire_leggings.png`
Boots:
`20004`
`frostfire_boots.png`
Create:
`CosmicWeapons-ResourcePack/`
with:
* `pack.mcmeta`
* `assets/`
* correct item definitions
* model files where required
* textures
* correct 1.21.11 structure
Normal Netherite Sword, Mace and armor MUST keep their vanilla textures.
Only the custom items should use the custom textures.
Explain exactly where I should put all six PNG files.
Make the resource pack ready to ZIP and use in Minecraft.
---
# 📋 COMMANDS
`/custom 1`
→ Cosmic Blade
`/custom 2`
→ Thunder Mace
`/custom`
→ Show weapon help
`/customarmor 1`
→ Complete Frostfire Aegis set
Permission:
`cosmicweapons.give`
---
# ⚙️ CONFIG.YML
Create a complete configuration.
Everything important must be configurable:
## Cosmic Blade
* damage
* radius
* knockback
* cooldown
* Sonic Boom damage
* Sonic Boom range
* Sonic Boom width
* Dash distance
* Dash speed
* Dash cooldown
* particle amount
## Thunder Mace
* Thunder Strike damage
* radius
* cooldown
* knockback
* Earth Shatter damage
* radius
* cooldown
* knockback
* Wind Burst launch strength
* forward strength
* Storm Impact chance
* bonus damage
## Frostfire Aegis
* Protection level
* Unbreaking level
* health bonus
* speed level
* jump level
* night vision
* Revenge cooldown
* Ice duration
* Fire duration
* Blindness duration
## Messages
Make all important messages configurable.
---
# 🛡️ SAFETY & PERFORMANCE
The plugin must:
* Never break blocks with abilities.
* Never permanently set the world on fire.
* Never cause infinite loops.
* Never permanently modify player health.
* Never leave potion effects after armor is removed.
* Never stack attribute modifiers.
* Clean up effects after death/respawn/reconnect.
* Avoid excessive particle spam.
* Avoid expensive per-tick scans.
* Avoid unnecessary teleport calls.
* Avoid causing server lag or rubber-banding.
---
# 📁 COMPLETE PROJECT STRUCTURE
Create everything from scratch:
CosmicWeapons/
├── pom.xml
└── src/
└── main/
├── java/
│ └── com/kodari/cosmicweapons/
│ ├── CosmicWeaponsPlugin.java
│ ├── command/
│ │ ├── CustomCommand.java
│ │ └── CustomArmorCommand.java
│ ├── item/
│ │ ├── CosmicBlade.java
│ │ ├── ThunderMace.java
│ │ └── FrostfireAegis.java
│ ├── ability/
│ │ ├── CosmicBladeAbilities.java
│ │ ├── ThunderMaceAbilities.java
│ │ └── FrostfireRevenge.java
│ └── listener/
│ └── ArmorEffectListener.java
│
└── resources/
├── plugin.yml
└── config.yml
You may create additional classes if necessary.
---
# 🔧 BUILD
The project MUST compile successfully with:
`mvn clean package`
Final JAR:
`target/cosmicweapons-1.0.0.jar`
Before finishing, check and fix:
* All Java imports
* Package names
* File paths
* Maven configuration
* Paper 1.21.11 API
* plugin.yml
* Commands
* Permissions
* Config loading
* PersistentDataContainer
* Item creation
* Enchantments
* Event handling
* Cooldowns
* Armor attributes
* Resource-pack compatibility
Actually create ALL project files.
Do not give pseudocode or incomplete code.
At the end, explain everything in simple Bangla:
1. How to compile.
2. Where the JAR is.
3. How to install it.
4. `/custom 1`
5. `/custom 2`
6. `/customarmor 1`
7. Every ability.
8. Armor effects.
9. How to install the resource pack.
10. Where all six PNG textures go.
11. Any limitation regarding Shift + T Dash detection.
The final result must be a stable, optimized, premium-looking **CosmicWeapons** plugin for Paper 1.21.11.
Create the Paper 1.21.11 Maven plugin, commands, custom items, abilities, armor effects, and configuration.
Create the separate modern resource-pack structure and document the six PNG locations and armor-appearance limitation.
CosmicWeapons plugin ও আলাদা resource-pack structure তৈরি করা হয়েছে।
Compile: প্রজেক্টের মূল ফোল্ডারে Java 21 ও Maven ব্যবহার করে চালান:
Shellmvn clean packageJAR তৈরি হবে
target/cosmicweapons-1.0.0.jar-এ। এই পরিবেশে Maven build চালানো হয়নি।Plugin install: JAR-টি Paper সার্ভারের
plugins/ফোল্ডারে রেখে সার্ভার restart করুন। কনফিগ পাবেনplugins/CosmicWeapons/config.yml-এ।Commands:
/customhelp দেখায়;/custom 1Cosmic Blade এবং/custom 2Thunder Mace দেয়।/customarmor 1সম্পূর্ণ Frostfire Aegis set দেয়। জায়গা না থাকলে বাকি আইটেম মাটিতে drop হবে। এগুলোর জন্যcosmicweapons.givepermission প্রয়োজন।Cosmic Blade: সাধারণ right-click-এ Cosmic Rift, আর sneak + right-click-এ Sonic Boom চলে। Rift-এর damage, radius, knockback, cooldown এবং Sonic Boom-এর damage, range, width কনফিগে বদলানো যাবে।
Thunder Mace: right-click-এ Thunder Strike, sneak + right-click-এ Earth Shatter। আঘাতে Wind Burst V target-কে ওপরে launch করে; Storm Impact-এর chance ও bonus damage কনফিগে আছে। Lightning effect শুধু দৃশ্যমান—block ভাঙে না।
Frostfire Aegis: helmet-এ Night Vision, leggings-এ Jump Boost III, boots-এ Speed III এবং chestplate-এ সর্বোচ্চ 30 HP। সম্পূর্ণ set পরলে হালকা particle aura ও action bar দেখা যায়। কোনো piece খুললে সংশ্লিষ্ট effect সরানো এবং health value ফিরিয়ে দেওয়ার ব্যবস্থা আছে। Set-এর piece পরা অবস্থায় অন্য player আঘাত করলে wearer-প্রতি cooldown মেনে attacker-এর ওপর Ice, Fire বা Blindness-এর একটি effect পড়ে।
Resource pack:
CosmicWeapons-ResourcePack/-এর ভেতরের contents ZIP করুন—pack.mcmetaযেন ZIP-এর root-এ থাকে। ZIP-টি.minecraft/resourcepacks/-এ রাখুন এবং Minecraft-এর Resource Packs menu থেকে চালু করুন।PNG texture-গুলোর অবস্থান:
CosmicWeapons-ResourcePack/assets/cosmicweapons/textures/item/cosmic_blade.pngCosmicWeapons-ResourcePack/assets/cosmicweapons/textures/item/thunder_mace.pngCosmicWeapons-ResourcePack/assets/cosmicweapons/textures/item/frostfire_helmet.pngCosmicWeapons-ResourcePack/assets/cosmicweapons/textures/item/frostfire_chestplate.pngCosmicWeapons-ResourcePack/assets/cosmicweapons/textures/item/frostfire_leggings.pngCosmicWeapons-ResourcePack/assets/cosmicweapons/textures/item/frostfire_boots.png
PNG artwork ফাইলগুলো দেওয়া হয়নি; pack-এ তাদের model ও item definitions তৈরি আছে। PNG যোগ করার পর ZIP করুন। Custom armor PNG-গুলো inventory icon বদলাবে; শুধু CustomModelData দিয়ে vanilla Paper item-এর worn armor texture আলাদা করা যায় না।
Dash key limitation: সাধারণ Bukkit/Paper plugin physical T key শনাক্ত করতে পারে না। তাই Dash-এর নির্ভরযোগ্য বিকল্প হিসেবে sneak + Swap Hands (সাধারণত F) ব্যবহার করা হয়েছে। Dash velocity দিয়ে চলে—মাঝপথে teleport packet পাঠায় না।
package com.kodari.cosmicweapons;
import com.kodari.cosmicweapons.ability.CosmicBladeAbilities;
import com.kodari.cosmicweapons.ability.FrostfireRevenge;
import com.kodari.cosmicweapons.ability.ThunderMaceAbilities;
import com.kodari.cosmicweapons.command.CustomArmorCommand;
import com.kodari.cosmicweapons.command.CustomCommand;
import com.kodari.cosmicweapons.item.CosmicBlade;
import com.kodari.cosmicweapons.item.FrostfireAegis;
import com.kodari.cosmicweapons.item.ThunderMace;
import com.kodari.cosmicweapons.listener.ArmorEffectListener;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.ChatColor;
import org.bukkit.NamespacedKey;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public final class CosmicWeaponsPlugin extends JavaPlugin {
private CosmicBlade cosmicBlade;
private ThunderMace thunderMace;
private FrostfireAegis frostfireAegis;
private ArmorEffectListener armorEffectListener;
@Override
public void onEnable() {
saveDefaultConfig();
cosmicBlade = new CosmicBlade(this);
thunderMace = new ThunderMace(this);
frostfireAegis = new FrostfireAegis(this);
armorEffectListener = new ArmorEffectListener(this);
getServer().getPluginManager().registerEvents(new CosmicBladeAbilities(this), this);
getServer().getPluginManager().registerEvents(new ThunderMaceAbilities(this), this);
getServer().getPluginManager().registerEvents(new FrostfireRevenge(this), this);
getServer().getPluginManager().registerEvents(armorEffectListener, this);
getCommand("custom").setExecutor(new CustomCommand(this));
getCommand("customarmor").setExecutor(new CustomArmorCommand(this));
armorEffectListener.start();
}
@Override
public void onDisable() {
if (armorEffectListener != null) armorEffectListener.cleanupAll();
}
public CosmicBlade cosmicBlade() { return cosmicBlade; }
public ThunderMace thunderMace() { return thunderMace; }
public FrostfireAegis frostfireAegis() { return frostfireAegis; }
public String message(String path) { return color(getConfig().getString("messages." + path, "&cMissing message: " + path)); }
public String color(String text) { return ChatColor.translateAlternateColorCodes('&', text == null ? "" : text); }
public void sendMessage(CommandSender sender, String path) { sender.sendMessage(message("prefix") + message(path)); }
public void sendActionBar(Player player, String path) {
player.sendActionBar(LegacyComponentSerializer.legacySection().deserialize(message(path)));
}
public NamespacedKey key(String value) { return new NamespacedKey(this, value); }
}