A simple addition to Datapack Advancement syntax, the Reward Function argument specifically.
Example:
"rewards": {
"function": {
"functions": [
"namespace:function_1",
"namespace:function_2"
],
"input": [
{"1": "entity_uuid"},
{"2": "entity_type"},
{"3": "block_location"},
{"4": "block_type"}
]
}
}
The "functions" array is self explanatory. Every function listed is run at once, in the order of the list.
The "input" array works exactly like including that same JSON after a function in the /function command, except the second input refers to an argument in the rest of the advancement.
"entity_uuid" would provide target entity's UUID as a string, so if the trigger is "minecraft:player_hurt_entity", and the player hurts a pig, it would provide the UUID of the pig.
"entity_type" would provide the type of the target entity as a string, along with the namespace, so if the trigger is "minecraft:player_hurt_entity", and the player hurts a pig, it would provide "minecraft:pig".
"block_location" would provide the position of the target block as an integer, so if the trigger is "minecraft:placed_block", and the player places a campfire, it would provide the position of the campfire.
"block_type" would provide the type of the target block as a string, along with the namespace, so if the trigger is "minecraft:placed_block", and the player places a campfire, it would provide "minecraft:campfire".
Please sign in to leave a comment.
0 Comments