Advancement trigger "minecraft:tick" does not support standard "player" predicate
The bug
As of 20w18a, all advancement triggers (with the intended exception of impossible) have access to a player predicate to check the player that activated the trigger. An example:
{
"criteria": {
"test": {
"trigger": "minecraft:location",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_sprinting": true
}
}
}
]
}
}
}
}
However, the predicate does not work in the minecraft:tick trigger.
{
"criteria": {
"test": {
"trigger": "minecraft:tick",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"flags": {
"is_sprinting": true
}
}
}
]
}
}
}
}
Code analysis
Using Mojang's mappings for 20w18a:
There are two trigger methods in net.minecraft.advancements.critereon.SimpleCriterionTrigger: one that takes in a predicate (which, to be clear, is a consolidation of the trigger's conditions, not player) and one that does not. The first method checks the player predicate but the second does not.
minecraft:tick uses the second method, preventing the use of player.
2020-04-30, 04:30 AM
2020-06-08, 07:12 PM
2020-06-08, 07:12 PM
12
8