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.

Omegaa

Members
  • Joined

  • Last visited

Everything posted by Omegaa

  1. Current code posted is identical to old code. Anyway, your inability to kill the fire probably has to do with the fact that onItemRightClick is client-side-only. When I was doing this kind of stuff, I had to use packets to properly make right-click functionality work correctly. Current code posted is identical to old code. Lightning.setPosition(Coord.blockX,Coord.blockY+1,Coord.blockZ); Coord.blockY+1 +1
  2. Ok I fixed it slightly since Draco helped.. Thanks Draco! Here is my current code: public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer Entityplayer) { Vec3 look = Entityplayer.getLookVec(); MovingObjectPosition Coord = Entityplayer.rayTrace(300, 1); EntityLightningBolt Lightning = new EntityLightningBolt(world, 1, 1, 1); Lightning.setPosition(Coord.blockX,Coord.blockY+1,Coord.blockZ); world.spawnEntityInWorld(Lightning); return itemStack; but now I'm getting fire underneath me, I have tried to remove it but couldn't, any ideas?
  3. I have tried a few times but couldn't seem to get the right code... Could you give a example please?
  4. Thanks
  5. Hello, I've been making a new mod and I added this code: @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer Entityplayer) { Vec3 look = Entityplayer.getLookVec(); MovingObjectPosition Coord = Entityplayer.rayTrace(300, 1); EntityLightningBolt Lightning = new EntityLightningBolt(world, 1, 1, 1); Lightning.setPosition(Coord.blockX,Coord.blockY,Coord.blockZ); world.spawnEntityInWorld(Lightning); return itemStack; to make lightning on right click, however in creative it works but in survival it damages the player, how can I prevent it from hurting the player but still hurt mobs and other players.

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.