Started by
Just_A_Random_Dude
on
Topic category: Help with Minecraft modding (Java Edition)
So I'm making a custom Entity and i wanted it to only be damaged by a custom weapon i made, but i want a variable that needs to be true to be able to attack the Entity.
Use the on entity hurt global trigger, not on the entity, then check entity is type your_custom_entity. Check if item in main hand of source entity does not = sword OR variable = false, then cancel trigger.
This will mean that the player must use the sword and the variable must be true to deal damage to it