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

I have piece of armour that increases the player's jump height when worn. I have achieved this by using the living jump event, which works fine in single player, but on multiplayer the effect triggers when the player wearing the item is attack or otherwise knocked back/upward.

 

I am trying to avoid using keybinds, which is why I am using the jump event. I am just not sure why it fires when the jump key isn't pressed.

 

I have tried checking is the player was recently hurt and not proceeding if true, but that doesn't seem like a great way to do it.

I've been trying to fix this for several days, and that's the best I could come up with, so suggestions would be greatly appreciated.

Give the player jump boost for 0 tick whenever he is wearing the armor piece.

 

If the player only requires one armor piece to activate the jump effect you can do this by overwriting the onArmorTick method in you ItemArmor class, and do it there. If the player requires more than one armor piece you'll have to do it in some event and check if the player is wearing the armor.

I might be terribly wrong.. Like really, really wrong. But I'm just trying to help.

  • Author

I would rather do this without using the jump boost potion effect on armour tick, and like I said I have already got a working jump boost. My question wasn't how to make the player jump higher, but why does livingJump trigger when the player is knocked and how can I prevent it.

It's strange. I traced the jump event call hierarchy and there is one place that might be a bit buggy.

 

In NetHandlerPlayServer, in the processPlayer(C03PlayerPacket) it calls a player jump() method based on the following logic:

 

                if (this.playerEntity.onGround && !packetIn.isOnGround() && d12 > 0.0D)

                {

                    this.playerEntity.jump();

                }

 

And d12 is simply the player posY. I'm not really sure why it is checking if the Y position is greater than 0.0D because that position is down in the ground, I guess it is just to disallow jumping if you're falling through the bottom?

 

What is interesting is that it isn't looking at the isJumping boolean, but simply based on if the player update says that the player isn't on the ground!

 

So I think it may be a bug because I assume that the isOnGround() would also be false when knocked back, falling, and so forth.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

  • Author

I had guessed it was something like checking the Y motion, or what not. Just thought it was really odd, as it seems like a bug.

I can work around it with a keybind for my item, instead of livingJump (just didn't really want to), unless anyone has a good idea on a work around.

 

Also, would it be a good idea to report this as a bug?

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.