Interface PlayerKeyListener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
An interface for listening to key presses from a player
You can register this using the
It is important to note that this only works when the player is in a GUI that has a
You can register this using the
PlayerPartyStorage.registerKeyListener(PlayerKeyListener)
method.
It is important to note that this only works when the player is in a GUI that has a
PixelmonItems.ui_element
in it-
Method Summary
Modifier and TypeMethodDescriptionvoid
onKeyPress
(net.minecraft.server.level.ServerPlayer player, int keyCode, int scanCode, int modifiers) Called when a player presses a key
-
Method Details
-
onKeyPress
void onKeyPress(net.minecraft.server.level.ServerPlayer player, int keyCode, int scanCode, int modifiers) Called when a player presses a key- Parameters:
player
- The player that pressed the keykeyCode
- The key code of the key that was pressedscanCode
- The scan code of the key that was pressedmodifiers
- The modifiers of the key that was pressed
-