I am making a custom enchantment plugin, pls don't yell at me but I am doing fake enchantments with lore (lol).
Anyways, I have a custom enchant which is a Boots enchant where if they are equipped, they give speed effect SuperSonic 2.
Again don't yell at me pls xd I am new to development in general.
My event (which is registered): https://pastebin.com/Spkk8Ub3
My main class (showing the event registered in the registerenchants function): https://pastebin.com/bgTNAgEn
So my issue is when attempting this in game, I put the boots on with the custom enchant on them and the speed effect is not given.
Interestingly enough however, if I change this part:
if (e.getNewItem().getCustomName().contains("§aSuperSonic 1")){
}
to
if (p.getInventory().getBoots().getCustomName().contains("§aSuperSonic 1")){
}
it will work but then when i goto remove the effect when the boots are taken off using
else if (oldID.getId() == 313){
p.removeEffect(Effect.SPEED);
}
same issue as before.
I hope I make sense here lol.
EDIT
Nevermind fixed it lol
Anyways, I have a custom enchant which is a Boots enchant where if they are equipped, they give speed effect SuperSonic 2.
Again don't yell at me pls xd I am new to development in general.
My event (which is registered): https://pastebin.com/Spkk8Ub3
My main class (showing the event registered in the registerenchants function): https://pastebin.com/bgTNAgEn
So my issue is when attempting this in game, I put the boots on with the custom enchant on them and the speed effect is not given.
Interestingly enough however, if I change this part:
if (e.getNewItem().getCustomName().contains("§aSuperSonic 1")){
}
to
if (p.getInventory().getBoots().getCustomName().contains("§aSuperSonic 1")){
}
it will work but then when i goto remove the effect when the boots are taken off using
else if (oldID.getId() == 313){
p.removeEffect(Effect.SPEED);
}
same issue as before.
I hope I make sense here lol.
EDIT
Nevermind fixed it lol
Last edited: