custom enchantment books for bows they should be spawned in the chests of the bastions, and the ancient city also can be acquired by trading with villagers but with high cost I'm providing you with names and their requirements in the following format name: requirement Gale Shot: wind charge effect on the player when shot with arrow Draconic Wrath: dragons breath appears on player who was shot and suffocates him Silver Fever: When shot at someone 1 silverfish spawn on the player Frostbite: Powder snow effect when hit, player freeze for 3 seconds make sure when plugin runs smoothly when server's turned the plugin says "OK" if the command /luke is ran the plugin should respond with "OK" and display the number of enchantment books are in the server and their location
I’ll create a custom bow enchantment plugin with four unique enchantments that spawn in structures and can be traded with villagers.
Now I’ll create the remaining files for the plugin:
All files created. The plugin features four custom bow enchantments that spawn in bastion and ancient city chests, can be traded from librarian villagers at high emerald costs, and includes the /luke command to track all enchanted books across the server with their locations.
the costs for the trading is 1 netherite block and 1 nether star and it should be done only with the librarian and make sure the plugin runs perfectly on paper mc server and modify the code for the max efficiency also make sure the PLUGIN says PING Pong when the server starts running and when a player joins the server
I’ll modify the plugin to:
Set trading costs to 1 netherite block + 1 nether star (librarian only)
Add “PING Pong” messages on startup and player join
Optimize for Paper MC server with maximum efficiency
All changes implemented successfully:
Trading cost: Changed from emeralds to 1 netherite block + 1 nether star (librarian only)
PING Pong messages: Added on server startup and player join
Paper compatibility: Switched to Paper API for better performance
Optimizations: Cached XMaterial instances, improved loops, removed inefficient comparisons, pre-sized collections, optimized loot key checking
Removed villager-cost from config since it’s now fixed items
The plugin will now display “PING Pong” in console on startup and send “PING Pong” message to players when they join!
Hey, the book count is zero by default can you make that atleast 1 book of each enchantment is spawned in a bastion or the ancient city chests, and make sure to put the coordinates of the enchantment books in the /luke command with the count
I’ll read the relevant files to understand the current implementation and make the necessary changes.
I’ll update the ChestPopulationListener to guarantee at least 1 book of each enabled enchantment spawns in bastion and ancient city chests, and improve the /luke command output format for coordinates.
The changes I made:
ChestPopulationListener: Now guarantees at least 1 book of each enabled enchantment spawns first, then applies chance-based spawning for additional books up to the max limit.
LukeCommand: Improved the output format to show coordinates grouped by enchantment type with the count, making it much easier to read and locate specific books.
the /luke command list is not getting updated and the enchantment books are not spawning it's faulty modify the code to the max efficiency please
I’ll read all the files to identify and fix the issues with the /luke command list and enchantment book spawning.
I found the issues:
ChestPopulationListener - Currently adds ALL enchantments unconditionally in the first loop, ignoring spawn chances
LukeCommand - Not properly handling null items in inventory arrays
Let me fix both with maximum efficiency:
set the total number of custom bow enchantment books spawning to be 5 and at least 2 of them each should spawn and make sure the custom enchantment only works with the bow and add a command /ebow which can be used to enchant the bow with custom enchantments listed by me earlier
I’ll read the existing files to understand the current implementation and make the necessary changes.
Now I’ll implement the requested changes:
Set max books to 5 per chest with guaranteed minimum spawns
Add anvil restriction so custom enchantments only work on bows
Create /ebow command with GUI to enchant bows
Done! I’ve implemented all the requested features:
Set total to 5 books per chest with minimum 2 - Updated chest population to spawn 2-5 books per chest guaranteed
Custom enchantments only work on bows - Added AnvilListener that prevents applying custom enchantment books to anything except bows, and prevents bows from getting multiple custom enchantments
Added /ebow command - Created interactive GUI that lets players enchant their held bow with any of the 4 custom enchantments (Gale Shot, Draconic Wrath, Silver Fever, Frostbite)
make sure the command /ebow enchants the bow with given request like for example the player wants to enchant bow with gale shot he does /ebow gale_shot with bow holding in his hand such that the enchantment applies to it
I’ll read the relevant files to understand the current implementation and then modify the command to enchant the bow in the player’s hand.
I’ll modify the /ebow command to directly enchant the bow with the specified enchantment when an argument is provided.
The /ebow command now works as follows:
Usage:
/ebow <enchantment_name>- Player must hold a bow and specify the enchantmentSupported formats:
gale_shot,gale-shot, orGale Shot(case-insensitive)Examples:
/ebow gale_shot- Applies Gale Shot enchantment/ebow draconic-wrath- Applies Draconic Wrath enchantment/ebow Silver Fever- Applies Silver Fever enchantment/ebow frostbite- Applies Frostbite enchantment
The command validates that the player is holding a bow, checks if it already has an enchantment, and applies the specified enchantment directly.
there are some addons I would like,
- the dragon breath visual effect should be visible, and the effect should stay longer for minimum 3 seconds
- galeshot needs to be fixed the windcharge visual effect should be visible and the player should get the levitation effect caused by windcharge no matter where he was hit by the arrow
- the powdersnow effect in the frostbite should stay longer atleast for minimum 4 seconds
I’ll read the existing code to understand how these enchantments are currently implemented.
Now I’ll update the code to add the visual effects and fix the durations:
All three enchantments have been updated:
Draconic Wrath - Now spawns a visible dragon breath area effect cloud that lasts minimum 3 seconds (default 5) with purple dragon breath particles
Galeshot - Now spawns wind charge particle effects (GUST_EMITTER_LARGE) and applies levitation effect to the target
Frostbite - Duration increased to minimum 4 seconds (config default now 4) with added snowflake particle effects for better visibility
there are few faults,
- for the silver-fever enchantment the silverfishes are not spawning on the player as i supposed to be and one silverfish should spawn for one arrow which hit the player
2.for the draconic-wrath enchantment, the breath is not dragon breath. it should be purple dragonic breath particles, and it should cause 4 hearts damage no matter the armour player's wearing. the dragon breath particles should last only 3 seconds per arrow
- the frostbite enchantment is not working good and it's giving glowing effect for the player who's hit, it should give powdersnow suffocating effect for minimum 4 seconds
I’ll read the current implementation to identify and fix the issues with these three enchantments.
I can see the issues. Let me fix them:
Silver Fever: Silverfishes spawn at ground level instead of on the player
Draconic Wrath: Uses area effect cloud instead of direct damage + purple particles
Frostbite: setFreezeTicks isn’t creating the powder snow suffocation effect properly
Fixed all three enchantments:
Silver Fever now spawns one silverfish on the player (at their location + 1 block up) per arrow hit
Draconic Wrath deals 4 hearts (8 damage) ignoring armor and spawns purple dragon breath particles for exactly 3 seconds
Frostbite applies powder snow freezing effect continuously for minimum 4 seconds with slowness effect
make sure all enchantments are got their good visual effects and they dont last for more than max 5 seconds and minimum 2 seconds
I’ll read the existing code to check the current visual effects implementation and ensure all enchantments have proper effects within 2-5 seconds duration.
I’ll update the visual effects for all enchantments to ensure they last between 2-5 seconds with good visual feedback.
All enchantments now have enhanced visual effects lasting 2-5 seconds:
GALE_SHOT (3 seconds): Wind gusts + clouds + explosions with launch sound DRACONIC_WRATH (2-5 seconds configurable, default 3): Dragon breath + witch particles + soul flames with dragon growl SILVER_FEVER (3 seconds): Silverfish particles + crits + enchantment sparkles with silverfish sound FROSTBITE (2-5 seconds configurable, default 4): Snowflakes + clouds + snowball bursts with glass break sound
- the draconic wrath is not showing any kind of visual effect. I want purple dragon breath cloud to appear on the player who's hit by the arrow and the cloud disappears after 4 seconds.
- also add a 5th enchantment named HotShot and when a player is hit by an arrow it should do 3 hearts damage irrespective of armour and potion effects and the block above the block which player is standing should turn into lava which is about to disappear and the effect should not last long not more than 3 seconds
- the silver fever should spawn only 2 silverfish per one bow shot and the visual effects for it are good
- add a command named /ebooks and when player enters this command the chest INVENTORY GUI should show all the 5 custom bow enchantments books in it and the player can take the enchantment books out of the chest INVENTORY GUI from the command. when this command is done the books should be there no matter how times done
- fix all the bugs and non useful code
the draconic wrath is not showing any kind of visual effect. I want purple dragon breath cloud to appear on the player who's hit by the arrow and the cloud disappears after 4 seconds. also add a 5th enchantment named HotShot and when a player is hit by an arrow it should do 3 hearts damage irrespective of armour and potion effects and the block above the block which player is standing should turn into lava which is about to disappear and the effect should not last long not more than 3 seconds
package com.bowenchants;
import com.bowenchants.command.EbowCommand;
import com.bowenchants.command.LukeCommand;
import com.bowenchants.listener.AnvilListener;
import com.bowenchants.listener.ChestPopulationListener;
import com.bowenchants.listener.PlayerJoinListener;
import com.bowenchants.listener.ProjectileListener;
import com.bowenchants.listener.VillagerTradeListener;
import com.bowenchants.manager.EnchantmentManager;
import lombok.Getter;
import org.bukkit.plugin.java.JavaPlugin;
@Getter
public class BowEnchantmentsPlugin extends JavaPlugin {
private EnchantmentManager enchantmentManager;
@Override
public void onEnable() {
saveDefaultConfig();
this.enchantmentManager = new EnchantmentManager(this);
getServer().getPluginManager().registerEvents(new ChestPopulationListener(this), this);
getServer().getPluginManager().registerEvents(new ProjectileListener(this), this);
getServer().getPluginManager().registerEvents(new VillagerTradeListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerJoinListener(), this);
getServer().getPluginManager().registerEvents(new AnvilListener(this), this);
EbowCommand ebowCommand = new EbowCommand(this);
getCommand("ebow").setExecutor(ebowCommand);
getServer().getPluginManager().registerEvents(ebowCommand, this);
getCommand("luke").setExecutor(new LukeCommand(this));
getLogger().info("PING Pong");
}
@Override
public void onDisable() {
getLogger().info("BowEnchantments disabled");
}
}