Advertisement
Guest User

Untitled

a guest
Apr 10th, 2020
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. public class CapabilityHandler {
  2. @SubscribeEvent
  3. public static void onAttachCapabilities(AttachCapabilitiesEvent<Entity> event) {
  4. if (isArmorableMob(event.getObject())) {
  5. event.addCapability(new ResourceLocation(HardSteel.modid, "rearmer"), new ReArmerProvider());
  6. }
  7. }
  8.  
  9. public static boolean isArmorableMob(Entity entity){
  10. if((entity instanceof ZombieEntity) || // covers Zombies, Husks, Zombie Villagers and Zombie Pigmen
  11. (entity instanceof SkeletonEntity) ||
  12. (entity instanceof StrayEntity) ||
  13. (entity instanceof WitherSkeletonEntity)) return true;
  14. return false;
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement