ironkiller224 Posted July 12, 2018 Share Posted July 12, 2018 I'm trying to give a mob the tag "NoAI". Is there any way to give it a tag using just the entity instance? I attempted it this way: public class voidCharmEffect { @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onEvent(LivingUpdateEvent event){ EntityLivingBase entitya = event.getEntityLiving(); if(entitya instanceof EntityPlayer && entitya != null){ EntityPlayer entity = (EntityPlayer) entitya; if(entity.getHeldItemOffhand().getItem() == ModItems.voidCharm ){ GameSettings gs = Minecraft.getMinecraft().gameSettings; RayTraceResult mop = Minecraft.getMinecraft().objectMouseOver; if(mop != null){ if(mop.entityHit == null){ }else{ if(mop.entityHit instanceof EntityEnderman){ EntityEnderman target = (EntityEnderman) mop.entityHit; //System.out.println("found enderman"); target.getEntityData().setInteger("NoAI", 1); //System.out.println(target.getEntityData().toString()); } } } } } } } It detects the mob but the mob keeps moving around. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.