Scarpet: Add methods to query and modify the various fields in player `warden_spawn_tracker`
James103 opened this issue ยท 0 comments
As of Minecraft version 22w12a, there is a new field warden_spawn_tracker
in the player's NBT data.
Like almost all other such fields, there should be entity API methods to query and modify the various values in that set.
Example: Create a Scarpet app that implements the /warden_spawn_tracker
command from 1.19 Deep Dark Experimental Snapshot 1.
The following is to be added to the documentation (entities.md
) when this is implemented. Everything below is subject to change.
query(e, 'warden_warning_level')
The number of times the player has activated a Sculk Shrieker (0 to 3 inclusive), or null
if e
is not a player.
If this is 3, the next Sculk Shrieker activation will spawn a Warden.
query(e, 'warden_warning_cooldown')
The number of ticks before the player can activate another Sculk Shrieker, or null
if e
is not a player.
query(e, 'warden_warning_ticks')
The number of ticks since the player last activated a Sculk Shrieker, or null
if e
is not a player.
At 12000, it resets to zero and warden_warning_level
described above is decremented.
modify(e, 'warden_warning_level')
Set the number of times the player has activated a Sculk Shrieker (0 to 3 inclusive). Setting this to 3 causes the next activation within 12000-warden_warning_ticks
ticks to spawn a Warden. Has no effect if e
is not a player.
modify(e, 'warden_warning_cooldown')
Set the number of ticks before the player can activate another Sculk Shrieker. Has no effect if e
is not a player.
modify(e, 'warden_warning_ticks')
Set the number of ticks since the player last activated a Sculk Shrieker.
Setting this to 12000 or above resets it to 0 and decrements warden_warning_level
. Has no effect if e
is not a player.