Jump to content

Recommended Posts

Posted

Hello!

I'm trying to make a packet when the player press his jump keybind.

I have a custom item that allow you to double jump when equipped in a Bauble Slot (Belt slot).

 

Everything seems to work, i only need to know when the player press space when he's not touching the ground.

I already saw the Forge Doc about SimpleImpl, but i don't really get it.. Do i need 3 class? PacketHandler, MyMessage and MyMessageHandler? (I guess i can rename the Messages classes)

 

Here's the item im making :

  Reveal hidden contents

Can you guys give me examples?

Posted

What version

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted

I pretty much copied Botania's PacketHandler and PacketJump that looks pretty strange but i think that's pretty much what i want, and it's not doing anything so it might be outdated, or i did something wrong

Posted

Okay so here's what i did. Every println are showing up in the console, which mean everything is working, but the player.motionY = 0.42D; (Inside PacketJump) is not happening, and i don't have any errors. I think it might be a side problem, but i don't see how i can fix it

 

ClientProxy :

  Reveal hidden contents

 

KeyPressHandler :

  Reveal hidden contents

 

PacketHandler :

  Reveal hidden contents

 

PacketJump :

  Reveal hidden contents

 

The console output when i press space while in the air :

  Reveal hidden contents

 

Posted

You can get rid of your client proxy and use @EventBusSubscriber(modid = YourMod.MODID, value = Side.CLIENT) with static methods in your class

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 5/1/2019 at 3:03 PM, V0idWa1k3r said:

I know it seems counter-intuitive but player motion must be changed on the client, the server doesn't actually control it.

Expand  

How can i make the client execute player.motionY? world.isRemote isnt working here

Posted

I just tried the mod on server, and it's crashing about the EntityPlayerSP

  Reveal hidden contents

How can i make this thread-safe?

Posted
  On 5/2/2019 at 6:55 AM, Seynox said:

How can i make this thread-safe?

Expand  

This isn’t about thread safety, this is physical sides. Read https://mcforge.readthedocs.io/en/latest/concepts/sides/. Post your packet class

About Me

  Reveal hidden contents

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
  On 5/2/2019 at 7:02 AM, Cadiboo said:

Post your packet class

Expand  

 

PacketHandler :

  Reveal hidden contents

 

JumpPacket :

  Reveal hidden contents

 

Posted
  On 5/2/2019 at 7:43 AM, diesieben07 said:

Why do you check the side in onMessage? Your messages should usually only go one way.

You cannot access client-only classes from common code (such as your IMessageHandler). You need to encapsulate such access using the @SidedProxy system

Expand  

Can you give me an exemple? I have no idea how i can do this

 

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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