Jump to content

[1.15] How to freeze the movement of the player


Recommended Posts

I'm currently trying to create a mechanism on the Minecraft server that allows one player to use one item and stop the other players from moving. As a way of thinking
・ Modify the time tick of each Client game
・ By disabling the key input of all Clients, it becomes immobile.
There are two.
I tried the former with reference to Carpet Mod, but I gave up because it seems that I need to rewrite the Minecraft code of the part that is not supported by Forge. So, for the latter, I tried using KeyBinding # unPressAllKeys () etc., but I can still operate the viewpoint with the mouse, change the items I have, etc. Is there a way to solve these?

Link to comment
Share on other sites

I tried using MouseHelper#ungrabMouse () and KeyBinding#unPressAllKeys (), referring to the vanilla GUI code. Then, the mouse movement and the player movement became impossible. However, you can still switch items with the F5 key, mouse scroll, etc. (however, these may or may not work when pressed). This is to solve is to think of a thing that we need InputUpdateEvent, Can you tell me how to cancel how to input because they did not see any documents about it.

Link to comment
Share on other sites

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.

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.

  • Create New...

Important Information

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