СогласенИвент отменить не получится
Ну типа обработка идет тутно вроде у клавиш в Keyboard есть так называемые состояния нажатия, которые можно сделать false в этом ивенте, и как-будто не нажималось.
while (Keyboard.next())
{
KeyBinding.setKeyBindState(Keyboard.getEventKey(), Keyboard.getEventKeyState());
if (Keyboard.getEventKeyState())
{
KeyBinding.onTick(Keyboard.getEventKey());
}
if (this.field_83002_am > 0L)
{
if (getSystemTime() - this.field_83002_am >= 6000L)
{
throw new ReportedException(new CrashReport("Manually triggered debug crash", new Throwable()));
}
if (!Keyboard.isKeyDown(46) || !Keyboard.isKeyDown(61))
{
this.field_83002_am = -1L;
}
}
else if (Keyboard.isKeyDown(46) && Keyboard.isKeyDown(61))
{
this.field_83002_am = getSystemTime();
}
this.func_152348_aa();
if (Keyboard.getEventKeyState())
{
if (Keyboard.getEventKey() == 62 && this.entityRenderer != null)
{
this.entityRenderer.deactivateShader();
}
if (this.currentScreen != null)
{
this.currentScreen.handleKeyboardInput();
}
else
{
if (Keyboard.getEventKey() == 1)
{
this.displayInGameMenu();
}
if (Keyboard.getEventKey() == 31 && Keyboard.isKeyDown(61))
{
this.refreshResources();
}
if (Keyboard.getEventKey() == 20 && Keyboard.isKeyDown(61))
{
this.refreshResources();
}
if (Keyboard.getEventKey() == 33 && Keyboard.isKeyDown(61))
{
flag = Keyboard.isKeyDown(42) | Keyboard.isKeyDown(54);
this.gameSettings.setOptionValue(GameSettings.Options.RENDER_DISTANCE, flag ? -1 : 1);
}
if (Keyboard.getEventKey() == 30 && Keyboard.isKeyDown(61))
{
this.renderGlobal.loadRenderers();
}
if (Keyboard.getEventKey() == 35 && Keyboard.isKeyDown(61))
{
this.gameSettings.advancedItemTooltips = !this.gameSettings.advancedItemTooltips;
this.gameSettings.saveOptions();
}
if (Keyboard.getEventKey() == 48 && Keyboard.isKeyDown(61))
{
RenderManager.debugBoundingBox = !RenderManager.debugBoundingBox;
}
if (Keyboard.getEventKey() == 25 && Keyboard.isKeyDown(61))
{
this.gameSettings.pauseOnLostFocus = !this.gameSettings.pauseOnLostFocus;
this.gameSettings.saveOptions();
}
if (Keyboard.getEventKey() == 59)
{
this.gameSettings.hideGUI = !this.gameSettings.hideGUI;
}
if (Keyboard.getEventKey() == 61)
{
this.gameSettings.showDebugInfo = !this.gameSettings.showDebugInfo;
this.gameSettings.showDebugProfilerChart = GuiScreen.isShiftKeyDown();
}
if (this.gameSettings.keyBindTogglePerspective.isPressed())
{
++this.gameSettings.thirdPersonView;
if (this.gameSettings.thirdPersonView > 2)
{
this.gameSettings.thirdPersonView = 0;
}
}
if (this.gameSettings.keyBindSmoothCamera.isPressed())
{
this.gameSettings.smoothCamera = !this.gameSettings.smoothCamera;
}
}
if (this.gameSettings.showDebugInfo && this.gameSettings.showDebugProfilerChart)
{
if (Keyboard.getEventKey() == 11)
{
this.updateDebugProfilerName(0);
}
for (j = 0; j < 9; ++j)
{
if (Keyboard.getEventKey() == 2 + j)
{
this.updateDebugProfilerName(j + 1);
}
}
}
}
FMLCommonHandler.instance().fireKeyInput(); // Вот он наш ивент. Здрасте))
}
KeyBinding.setKeyBindState(Keyboard.getEventKey(), false);
Именно это мне и было нужно, благодарю.Ну хз, у меня когда-то получалось отменить любое передвижение и прыжки, когда игрок стоял в стане вот так
KeyBinding.setKeyBindState(Keyboard.getEventKey(), false);