Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. public class MoltenGauntletHitEvent
  2. {
  3. public static boolean hasItem;
  4.  
  5. @SubscribeEvent
  6. public static void attackWithGauntlet(LivingAttackEvent event) {
  7. if (!(event.getEntity() instanceof PlayerEntity)) {
  8.  
  9. if (hasItem)
  10. {
  11. event.getEntity().setFire(3);
  12. }
  13.  
  14. }
  15. }
  16.  
  17. @SubscribeEvent
  18. public static void checkAccessory(LivingEvent.LivingUpdateEvent event) {
  19. if (event.getEntity() instanceof PlayerEntity) {
  20.  
  21. PlayerEntity playerIn = (PlayerEntity) event.getEntity();
  22. World worldIn = playerIn.getEntityWorld();
  23.  
  24. if (playerIn.inventory.hasItemStack(new ItemStack(ItemInit.MOLTEN_GAUNTLET.get())))
  25. hasItem = true;
  26. else
  27. hasItem = false;
  28. }
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement