Add event for player toggling entity age lock#8555
Conversation
|
Please target dev/feature or dev/patch instead of master. (feature in this case) |
Oops sorry |
Absolutionism
left a comment
There was a problem hiding this comment.
Unsure if there is a delay when applying the new age lock to the entity.
Should check this to see if a EventValueExpression is needed, or if users can simply check the age lock on the event-entity to determine the behavior they wish to proceed with.
|
btw, no big concern, but the code snippet you provided does not match the output shown in the screenshot. |
Absolutionism
left a comment
There was a problem hiding this comment.
A JUnit test would be nice
…nts/events/EvtPlayerToggleEntityAge.java Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
…nts/events/EvtPlayerToggleEntityAge.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…nts/events/EvtPlayerToggleEntityAge.java Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
…t changes syntax because "test "EvtPlayerToggleEntityAge" if running minecraft "26.1" doesn't exist
…l handling in toString
APickledWalrus
left a comment
There was a problem hiding this comment.
Nearly ready, good work so far
| EventValues.registerEventValue(PlayerToggleEntityAgeLockEvent.class, LivingEntity.class, PlayerToggleEntityAgeLockEvent::getEntity); | ||
| EventValues.registerEventValue(PlayerToggleEntityAgeLockEvent.class, ItemStack.class, PlayerToggleEntityAgeLockEvent::getItem); |
There was a problem hiding this comment.
Can use updated event value registration. See BukkitEventValues for many examples
| .addEvent(PlayerToggleEntityAgeLockEvent.class) | ||
| .addPatterns("[player] entity age ([:un]lock|toggle:toggle) [of %-entitytypes%]") | ||
| .addDescription("Called when a player toggles the age lock of an entity using a golden dandelion.") | ||
| .addExample(""" |
There was a problem hiding this comment.
I would split this into 3 separate examples (one per event)
…nts/events/EvtPlayerToggleEntityAge.java Co-authored-by: SirSmurfy2 <82696841+Absolutionism@users.noreply.github.com>
Problem
Would be usefull to check if a player locks an entity age
Solution
Registered an event to be called wen a player locks an entity age
Testing Completed
Supporting Information
Completes: none
Related: none
AI assistance: none