-
-
Notifications
You must be signed in to change notification settings - Fork 109
Player input event #2764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Player input event #2764
Conversation
@@ -268,6 +268,9 @@ public class BukkitImplDeprecations { | |||
// Added 2025/03/14 | |||
public static Warning settingBoatType = new Warning("settingBoatType", "As of MC 1.21, separate boat wood types are separate entity types, meaning the wood type of an existing boat entity cannot be changed without spawning a new one."); | |||
|
|||
// Added 2025/08/18 | |||
public static Warning playerSteerEntityEvent = new Warning("playerSteerEntityEvent", "The 'player steers <entity>' is deprecated in favor of the 'player input' event."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'player steers <entity>' event
@@ -38,6 +40,8 @@ public class PlayerSteersEntityScriptEvent extends BukkitScriptEvent { | |||
// | |||
// @Player Always. | |||
// | |||
// @deprecated Use <@link event player input> on versions above 1.21. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link won't work, since @deprecated
uses plain-text
// @Triggers when a player sends updated input to the server. | ||
// | ||
// @Context | ||
// <context.is_backward> returns an ElementTag(Boolean) that signifies whether the player moves backward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could probably shorten all of these to returns whether the player input was <direction>
fixed |
// @Triggers when a player sends updated input to the server. | ||
// | ||
// @Context | ||
// <context.is_backward> returns whether the player moves backward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are a bit too definitive imo - the player is giving backwards input, but there's still many things that can stop them from actually moving backwards (I.e. this isn't the way to check if the player is actually moving).
I'd mybe do something like returns whether the player is trying to move backwards
or just straight up returns whether the player provided backwards movement input.
, but can discuss further on Discord.
@EventHandler | ||
public void onPlayerInputEvent(PlayerInputEvent event) { | ||
this.event = event; | ||
player = event.getPlayer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any specific reason to store the player here, as opposed to just event.getPlayer()
in getScriptEntryData
?
@@ -268,6 +268,9 @@ public class BukkitImplDeprecations { | |||
// Added 2025/03/14 | |||
public static Warning settingBoatType = new Warning("settingBoatType", "As of MC 1.21, separate boat wood types are separate entity types, meaning the wood type of an existing boat entity cannot be changed without spawning a new one."); | |||
|
|||
// Added 2025/08/18 | |||
public static Warning playerSteerEntityEvent = new Warning("playerSteerEntityEvent", "The 'player steers <entity>' event is deprecated in favor of the 'player input' event."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a SlowWarning
? the event still has back-support and everything, don't think we should go directly to Warning
here
resolved comments |
Additions:
player input
event, requested on discord https://discord.com/channels/315163488085475337/1349479278949044224Changes:
player steers <entity>
event