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.

iluvpie777

Members
  • Joined

  • Last visited

  1. Tried all of that still doesn't work also yes my event handler is registered
  2. So basically println() isn't working which means that the if statement isn't working I know for a fact that the IEEP counter works as I have used it for alot of other events and it works just fine here is my code, isDamaged() was like the only thing I found that checked if the item has been damaged if there is a better way to check a fishing rod after using it I'm all ears anyways here is my code: @SubscribeEvent public void useItem(Finish event) { EMIEEP props = EMIEEP.get(event.entityPlayer); if (event.entityPlayer.getHeldItem().getItem() == Items.fishing_rod && event.result.getItem().isDamaged(event.entityPlayer.getHeldItem())) { props.addToCounter(2.0); System.out.println(props.getCounter()); } }
  3. So I'm actually still having some trouble with this event, I'm trying to make it so that when a player uses a fishing rod and it's durability goes down a counter will add 2 but it's not working does anyone know why? code: @SubscribeEvent public void useItem(Finish event) { EMIEEP props = EMIEEP.get(event.entityPlayer); if (event.entityPlayer.getHeldItem().getItem() == Items.fishing_rod && event.result.getItem().isDamaged(event.entityPlayer.getHeldItem())) { props.addToCounter(2.0); System.out.println(props.getCounter()); } }
  4. Thanks, I managed to get the event working!
  5. Hi I'm just kind of confused on how this event works with it's start, tick, stop, and finish variables could someone please explain to me how to properly use these in the event? thanks
  6. Thank You! Everything is working perfectly now I didn't realize that everything I needed was in conext
  7. So I've mannaged to get SimpleNetworkWrapper working but the only place to execute the spawn entity code is here: code: @Override public IMessage onMessage(EMMessage message, MessageContext context) { return null; } So once again there is no world or player so how do I execute the spawn entity code
  8. So I'm kinda confused on how Simple Network Wrapper works, so basically it sends a string from the client side to server side, and the server takes that string and does stuff with it?
  9. Hi I've been trying to make an entity spawn next to the player when a specific key is pressed however in the KeyInputEvent there is no world or entity so how do I make it so when I press a certain button an entity spawns, or do I have to use a different event completely. It's not much help but here is my KeyInputEvent code Code: public class KeyHandler { public boolean isAttacking = false; World world; EntityPlayer player; private static Key getPressedKeybinding() { if (KeyBindings.attack.isPressed()) { return Key.ATTACK; } return Key.UKNOWN; } @SubscribeEvent public void handleKeyInputEvent(InputEvent.KeyInputEvent event) { if (KeyBindings.attack.isPressed()) { isAttacking = true; } } }
  10. nvm figured it out thx for the tip!
  11. how do i cast it to EntityLivingBase
  12. does anyone know how to give a projectile a potion effect? I've tried movingobjectposition.entityHit but there is no addPotionEffect option
  13. so I tried Blocks.flowing_water and it gets the spawned water flowing but it still stays, I want the blocks that are not permanent (the nonsource blocks) to spawn, is it possible to do this?
  14. oh wow lol, I searched through all the blocks and somehow missed it thx!
  15. Hi so I'm trying to make it so that when a mob gets hit by my projectile a puddle of water will spawn at it's feet however I'm not quite sure how to get the active water to spawn so that it goes away after a little bit. My code: @Override protected void onImpact(MovingObjectPosition movingobjectposition) { if (movingobjectposition.entityHit != null) { float getDmg = 2; movingobjectposition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.getThrower()), getDmg); int rand = random.nextInt(5); if (rand == 4) { int x = MathHelper.floor_double(this.posX); int y = MathHelper.floor_double(movingobjectposition.entityHit.posY); int z = MathHelper.floor_double(this.posZ); this.worldObj.setBlock(x, y, z, Blocks.water); } } for (int l = 0; l <7; ++l) { this.worldObj.spawnParticle("splash", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); } if (!this.worldObj.isRemote) { this.setDead(); } } as you see right now its block.water how do i get the active water?

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.