Jump to content

1.7 Item Particles, Specifing location


jewell012

Recommended Posts

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);

}

    }

   

    }

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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