Hi modders,
I know that 1.7.10 is a bit out dated but I must use this version form my mod.
My mod adds some crystal that give special powers. How this works?
Well, I created some Enchantments, then I add this Enchantments to an Item when this is put in an anvil with a crystal via the AnvilUpdateEvent in my EventHandler class. After doing this I check the special scenario always via the EventHandlers to do stuff. For example if you put in the anvil a sword and a blood crystal the sword obtain the "Life Steal" enchantment which heal u a bit after a kill. This works thanks to the LivingDeathEvent. The code (the imports are been deleted, don't know why):
Now, if u put in the anvil an armor piece and a dark Crystal the armor piece gain the "Assassin's Blessing" enchantment, which should make you invisible after a kill. Now, for make this works, over the events, I use a boolean variable. This is because I want to make all the pg invisible, even the armor and the held item. U know that if i add the potion effect (invisibility) to the player the armor and the held item will still visible. So i make the armor disappear thanks to the SetArmorModel event, which i discover be Client side only. If I play in my singleplayer world it all works, but when I test the mod in the server it doesen't work. Here's the code:
The handler for the dark powers:
The SetArmorModel event:
My proxys (Client and Common):
And the GlobalVariables class:
There is a way to make it works also on server or should I give up?
Thx for the help