Hello, I have been working with forge for a couple of months now but in that time period I have never had to use a forge hook until to day. What i need is when I kill and entity with my sword it runs a function. So when looking through the forge hooks I found a function onLivingDeath. After using it in my sword class I realized ForgeHooks was not connect to my sword file in any way. I tried a few things and nothing worked so if anyone knows how to call ForgeHooks onLivingDeath in a file like ItemSword I would like to know. Thanks in advance and have a nice day.
The first living check it to make it so you can hit entities like boats and minecarts with the item and not get crashed. the next check is again for if the entity is living. This is mainly just a double check but if wanted you can make it mob specific by changing EntityLiving to another entity class. The next check looks to see if the current item equipped is not null and is a blaze word. (Change MSMItems.blazesword.itemID to whatever your item is) I then put a third check again because you can never be too safe XD The last check looks to see if the enity is living. if so they will take 1000000 falling anvil damage.
Sorry if I made this unclear as I am in a hurry. If you have any further questions or this is not what you were looking for you can pm me.
This event will check when a mob gets hurt.
The first living check it to make it so you can hit entities like boats and minecarts with the item and not get crashed. the next check is again for if the entity is living. This is mainly just a double check but if wanted you can make it mob specific by changing EntityLiving to another entity class. The next check looks to see if the current item equipped is not null and is a blaze word. (Change MSMItems.blazesword.itemID to whatever your item is) I then put a third check again because you can never be too safe XD The last check looks to see if the enity is living. if so they will take 1000000 falling anvil damage.
Sorry if I made this unclear as I am in a hurry. If you have any further questions or this is not what you were looking for you can pm me.
Farewell everyone o/