Closed Psither closed 2 months ago
is getDefaultEnchantments
only called on the client?
How is the server going to determine the default enchantments? Why not pass a level / registry access to the method, don't the events have access to that (level or an entity)?
Also would recommend adding a new method to https://github.com/DragonSurvivalTeam/DragonSurvival/blob/1.21.x/src/main/java/by/dragonsurvivalteam/dragonsurvival/util/EnchantmentUtils.java which gets an enchantment, to cut down on boilerplate code
ItemStack doesn't have any way to access the level directly, or any entities to get the level from, and that's all that most of these methods get.
I mean at the moment it just wouldn't work, would it?
In applyDebuffs
you have an entity but still access the client minecraft instance
(and iirc effects can only really be modified on the server side)
same for the livingHurt
event
you could maybe populate a static list on ServerStartedEvent
(if the server has registry access, don't know tbh)
Instead of directly adding enchantments to NBT, it might be better to instead override getEnchantmentLevel()
and getAllEnchantments()
. That way the item is considered to have the enchantment for gameplay purposes, but it can't be removed with the grindstone, regular enchantments can still work, etc.
The first pass at having items that have built-in enchantments that can't be removed, but don't block normal enchanting logic
Fixes silk touch giving dragon dust items Fixes a body type not being assigned properly when using the dragon command without specifying it Fixes base body type not specifying health bonus