Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.afm.AfmMod.objects.items.armor.armor_events;
- import com.afm.AfmMod.init.ItemInit;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.inventory.EntityEquipmentSlot;
- import net.minecraft.item.ItemArmor;
- import net.minecraft.item.ItemArmor.ArmorMaterial;
- import net.minecraft.item.ItemStack;
- import net.minecraftforge.event.entity.living.LivingEvent;
- import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
- import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
- @EventBusSubscriber
- public class CamouflageHideEvent
- {
- @SubscribeEvent
- public static void LivingSetAttackTargetEvent(EntityPlayer entity, EntityLivingBase target)
- {
- if (target != null && target instanceof EntityPlayer)
- {
- EntityPlayer player = (EntityPlayer) target;
- boolean hasFullArmor = true;
- for (ItemStack stack : player.inventory.armorInventory)
- {
- if (((ItemArmor)stack.getItem()).getArmorMaterial() == ItemInit.CAMOUFLAGE_MATERIAL)
- {
- hasFullArmor = false;
- break;
- }
- }
- if (hasFullArmor)
- {
- }
- }
- }
- public EntityLivingBase getTarget()
- {
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement