Posted May 9, 20241 yr Hello. I want to make jump boost boots. But I'm not going to use jumpboost effect. I want to give player extra force. I tried to make it like this: Quote @Override public void inventoryTick(ItemStack pStack, Level pLevel, Entity pEntity, int pSlotId, boolean pIsSelected) { super.inventoryTick(pStack, pLevel, pEntity, pSlotId, pIsSelected); if(!pLevel.isClientSide) { if (pEntity instanceof Player player) { if (player.getItemBySlot(EquipmentSlot.FEET) == pStack) { if (Minecraft.getInstance().options.keyJump.consumeClick() && player.onGround()) { player.push(0.0,1.0,0.0); player.sendSystemMessage(Component.literal("test" + count)); count++; } } } } } But when I jump "player.push" method doesn't always work but "sendSystemMessage" works absolutly fine. What i did wrong?
May 10, 20241 yr From what I've found, you can only manipulate the player's motion on the client side. It's extremely annoying. If you know how to use packets, you can use packets to transfer the information from the server. Take a look at my implementation on GitHub here if you want. You'd want something similar to the way I've done the PlayerAddVelocityPacket. Unfortunately, packets are rather complex; I'd recommend you watch a few tutorials on them before even trying to work with them. Feel free to use my code as a reference, but please give attribution if you plan to directly copy it.
May 10, 20241 yr Author Thanks a lot. But I found an information that "Minecraft.getInstance().options.keyJump.consumeClick()" and other keybinding methods don't work on the server. But how when all my method works? I placed "if(!pLevel.isClientSide)" statement in the top of all but it somehow do the "sendSystemMessage" method.
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.