Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.