Jump to content

ironkiller224

Members
  • Posts

    6
  • Joined

  • Last visited

ironkiller224's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I edited my post to show my code.
  2. Does anyone know how to create particle effects in a specific location? I tried using World.spawnParticle but I cannot get it to work. Edit: Here's my code: @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public void onEvent(PlayerTickEvent event){ EntityPlayer p = event.player; if(p.getHeldItemOffhand().getItem() == ModItems.shieldCharm ){ List<Entity> L = p.getEntityWorld().getLoadedEntityList(); for(Entity e : L){ if(e instanceof EntityArrow){ EntityArrow e2 = (EntityArrow)e; if(e2.getDistance(p) < 3){ e2.motionX = 0; e2.motionY = 0; e2.motionZ = 0; if(e2.getEntityWorld().isRemote){ e2.getEntityWorld().spawnParticle(EnumParticleTypes.DRIP_WATER, e2.posX, e2.posY, e2.posZ, 0, 0, 0, 1); //System.out.println("particle summoned"); } } } } p.addPotionEffect(new PotionEffect(Potion.getPotionById(11), 5)); } } I am attempting to freeze the arrows in place near the player and add a particle effect (current effect is placeholder) to show they are being held in place by some magical air. The system prints out "particle summoned" but no particles show up in the world.
  3. this method is in the EntityEnderman.class and is what I am looking for. Thanks! private boolean shouldAttackPlayer(EntityPlayer player) { ItemStack itemstack = (ItemStack)player.inventory.armorInventory.get(3); if (itemstack.getItem() == Item.getItemFromBlock((Block)Blocks.PUMPKIN)) { return false; } Vec3d vec3d = player.getLook(1.0f).normalize(); Vec3d vec3d1 = new Vec3d(this.posX - player.posX, this.getEntityBoundingBox().minY + (double)this.getEyeHeight() - (player.posY + (double)player.getEyeHeight()), this.posZ - player.posZ); double d0 = vec3d1.lengthVector(); double d1 = vec3d.dotProduct(vec3d1 = vec3d1.normalize()); return d1 > 1.0 - 0.025 / d0 ? player.canEntityBeSeen((Entity)this) : false; }
  4. Where do I find the AIFindPlayer code?
  5. Is there some way to mark the player as having a pumpkin on his head without the pumpkin being there? Such as if the player held an item that had the same effect as wearing a pumpkin?
  6. 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.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.