Jump to content

iluvpie777

Members
  • Posts

    18
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

iluvpie777's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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. does anyone know how to give a projectile a potion effect? I've tried movingobjectposition.entityHit but there is no addPotionEffect option
  11. 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?
  12. oh wow lol, I searched through all the blocks and somehow missed it thx!
  13. 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?
×
×
  • Create New...

Important Information

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