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
Paper-only event player tracks|untracks <entity>
#2444
Paper-only event player tracks|untracks <entity>
#2444
Conversation
Because tracking isn't defined elsewhere, I'd recommend providing an explanation for what the actual behavior is in the meta. I don't think any other feature uses this vocabulary, so it makes sense to have it in the event meta rather than a separate language meta entry. |
https://meta.denizenscript.com/Docs/Mechanisms/entitytag.tracking_range
|
@EventHandler | ||
public void playerTracksEntityEvent(PlayerTrackEntityEvent event) { | ||
entity = new EntityTag(event.getEntity()); | ||
location = new LocationTag(event.getEntity().getLocation()); |
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.
Remove this, the location can be pulled from the entity via a tag if needed
@EventHandler | ||
public void playerUntracksEntityEvent(PlayerUntrackEntityEvent event) { | ||
entity = new EntityTag(event.getEntity()); | ||
location = new LocationTag(event.getEntity().getLocation()); |
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.
Same with previous comment, this can be removed
paper/src/main/java/com/denizenscript/denizen/paper/events/PlayerTracksEntityScriptEvent.java
Show resolved
Hide resolved
@@ -64,6 +64,7 @@ public static void init() { | |||
ScriptEvent.registerScriptEvent(PlayerSelectsStonecutterRecipeScriptEvent.class); | |||
ScriptEvent.registerScriptEvent(PlayerSpectatesEntityScriptEvent.class); | |||
ScriptEvent.registerScriptEvent(PlayerStopsSpectatingScriptEvent.class); | |||
ScriptEvent.registerScriptEvent(PlayerTracksEntityScriptEvent.class); |
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 events were added in 1.19, need a version check here
Thanks Mergu, Aya, Icecapade, and Wahrheit!
Thanks Mergu for the suggestions!
} | ||
|
||
@EventHandler | ||
public void playerTracksEntityEvent(PlayerTrackEntityEvent 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.
Should follow the onX
naming convention, I.e. onPlayerTracksEntity
(same for the other listener)
Done |
// @Player Always. | ||
// | ||
// @Example | ||
// # Narrate when the player tracks all entities except for item frames. |
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
not all
player tracks|untracks <entity>
For when the player stops or starts tracking an entity.
Contexts
<context.entity>
- the entity being tracked or untrackedremoved for redundancy (you can just use<context.location>
= the location of the entity<context.entity.location>
insteadRequested by Mergu on Discord
🛤️🛤️🛤️