Everything posted by ironkiller224
-
Particle Effects In Specific Spot?
I edited my post to show my code.
-
Particle Effects In Specific Spot?
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.
-
Preventing An Enderman's Aggro
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; }
-
Preventing An Enderman's Aggro
Where do I find the AIFindPlayer code?
-
Preventing An Enderman's Aggro
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?
-
Giving a mob an NBT tag while it's active
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.
IPS spam blocked by CleanTalk.