Advertisement
ButterAleks

CamouflageHideEvent

Apr 8th, 2019
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. package com.afm.AfmMod.objects.items.armor.armor_events;
  2.  
  3. import com.afm.AfmMod.init.ItemInit;
  4.  
  5. import net.minecraft.entity.EntityLivingBase;
  6. import net.minecraft.entity.player.EntityPlayer;
  7. import net.minecraft.inventory.EntityEquipmentSlot;
  8. import net.minecraft.item.ItemArmor;
  9. import net.minecraft.item.ItemArmor.ArmorMaterial;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraftforge.event.entity.living.LivingEvent;
  12. import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
  13. import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
  14.  
  15. @EventBusSubscriber
  16. public class CamouflageHideEvent
  17. {
  18. @SubscribeEvent
  19. public static void LivingSetAttackTargetEvent(EntityPlayer entity, EntityLivingBase target)
  20. {
  21. if (target != null && target instanceof EntityPlayer)
  22. {
  23. EntityPlayer player = (EntityPlayer) target;
  24. boolean hasFullArmor = true;
  25. for (ItemStack stack : player.inventory.armorInventory)
  26. {
  27. if (((ItemArmor)stack.getItem()).getArmorMaterial() == ItemInit.CAMOUFLAGE_MATERIAL)
  28. {
  29. hasFullArmor = false;
  30. break;
  31. }
  32. }
  33. if (hasFullArmor)
  34. {
  35.  
  36. }
  37. }
  38. }
  39.  
  40. public EntityLivingBase getTarget()
  41. {
  42. return null;
  43. }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement