Posted November 10, 20222 yr I have a mountable mob and I want to disable dismounting with shift key for it
November 10, 20222 yr You can try listening for key presses and resetting the state when your requirements are met. Something like: @Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT) public class ClientEvents { @SubscribeEvent public static void keyPress(InputEvent.Key event) { var minecraft = Minecraft.getInstance(); if (minecraft.options.keyShift.isDown() && minecraft.player.getVehicle() instanceof YourEntity) { minecraft.options.keyShift.setDown(false); } } } Edited November 10, 20222 yr by warjort Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
November 11, 20222 yr Author 14 hours ago, warjort said: You can try listening for key presses and resetting the state when your requirements are met. Something like: @Mod.EventBusSubscriber(modid = MODID, value = Dist.CLIENT) public class ClientEvents { @SubscribeEvent public static void keyPress(InputEvent.Key event) { var minecraft = Minecraft.getInstance(); if (minecraft.options.keyShift.isDown() && minecraft.player.getVehicle() instanceof YourEntity) { minecraft.options.keyShift.setDown(false); } } } It works thanks!
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.