Advancements that run functions now have an option to send event related data to the function in form of macro parameters.
Running functions from advancements is a very useful tool for datapack developers. Despite its many applications it is also
very limited in many situations. My suggestion aims to overcome these limits and make advancements much more versatile.
"rewards": {
"function": {
"path": "test:test_function",
"send_event_data": true
}
}
The send data depends on the type of trigger.
The consume_item trigger would have information about the player consuming the item as well as the item which was consumed.
The entity_hurt_player would have information about the player that was hurt, the attacking entity as well as the amount and type of damage dealt.
All this information could be accessed via macro parameters in the function.
The player parameter would contain all information about the player as NBT.
To access this information. The data would have to be put in a NBT storage first.
$data modify storage test:data player set value $(player)
This process could be made much easier by accessing the macro data directly which could be possible with this suggestion:
Please sign in to leave a comment.
2 Comments