How would I be able to dmg an entity such as cow, sheep, pig, or chicken. But only those 4. I have my server to block any entity dmg in the main world. What could I ad to the function to make it allow only the 4 entities to be damaged?
In the function, you could do PHP: /** @Entity $entity */ if($entity instanceof Cow || $entity instanceof Sheep || $entity instanceof Pig || $entity instanceof Chicken) { return; // return so the code doesn't execute on them. } I'm sure there are more effective ways, just none that I know would work, aside from putting the entity names in an array and checking if the entity in question's name is in it.