Jump to content

Recommended Posts

Posted

I am trying to cancel the dismount event, but its being weird. If I simply do the following in my event handler:

@SubscribeEvent
public void onMountEvent(EntityMountEvent e) {
        if (e.isDismounting()) {
            e.setCanceled(true);
        }
}

it will cancel successfully server side but my client does a weird thing where it sort of twitches back and forth and only lets me look up/down while not being able to move. If I try running the event with !world.isremote, it will only cancel server side and my client still dismounts (remounts when leaving/rejoining). How can I make this event cancel properly? 

Posted
29 minutes ago, diesieben07 said:

You probably have to cancel it on client and server.

My event handler is set up normally, so it runs on both client and server. When the event is cancelled it does indeed prevent me from dismounting, but then puts my player in a state where I can't move except to look up and down, so something is not working.

 

Also in past Minecraft versions it only worked if I just cancelled the event server side, but that no longer works either, so I'm sort of at a loss. 

Posted (edited)

Dismounting an entity on client causes an infinite loop. Further testing reveals that only the player is affected when dismounting and can still control the riding entity. Server information syncs to client on game reload. ClientPlayerEntity movement input is no longer being sampled nor is livingTick even called. ClientPlayerEntity overrides isSneaking making setSneaking for setting the flag pointless on the client.

 

This is most likely a bug.

Edited by ChampionAsh5357
Posted
7 minutes ago, ChampionAsh5357 said:

Dismounting an entity on client causes an infinite loop. Further testing reveals that only the player is affected when dismounting and can still control the riding entity. Server information syncs to client on game reload. ClientPlayerEntity movement input is no longer being sampled nor is livingTick even called. ClientPlayerEntity overrides isSneaking making setSneaking for setting the flag pointless on the client.

 

This is most likely a bug.

Thank you for testing this! So I guess this event is just sort of broken in the sense of not being cancellable right now :/

Posted
5 minutes ago, Electric said:

Thank you for testing this! So I guess this event is just sort of broken in the sense of not being cancellable right now :/

Sort of. The mounting can still be disabled. Only dismounting is bugged. The issue is that the client does not tick the PlayerEntity unless it is not riding an entity causing the movement flag to always be set to true.

  • Like 1

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.