Posted January 27, 201510 yr Alright, so I have been tinkering with particle effects when a player holds an Item and I have gotten It down, the only part I cant really figure out now is adjusting it to where its on the sword or Item rather than the player. The issue I have had with trying to set it on the Item specifically is when adjusting it gets stuck in a fixed position always either south or east of the player. This is the normal code, It spawns particles around player. Sorry for the format, the code insert isn't working for me @SideOnly(Side.CLIENT) public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) { EntityPlayer player = (EntityPlayer) par3Entity; Random rand = new Random(); if(player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() == PhantasyRealmsItems.drsabre) { for(int countparticles = 0; countparticles <= 2; ++countparticles) { par2World.spawnParticle("portal", player.posX + (rand.nextDouble() - 0.5D) * (double)player.width, player.posY + rand.nextDouble() * (double)player.height - (double)player.yOffset, player.posZ + (rand.nextDouble() - 0.5D) * (double)player.width, 0.0D, 0.0D, 0.0D); } } }
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.