Fixing min/max of location based advancements to account for negative values.

master
Ben Maurer 2022-08-03 02:12:31 +00:00
parent 6e9d1289f3
commit da06c87516
4 changed files with 154 additions and 89 deletions

View File

@ -19,7 +19,7 @@
"entity": "this", "entity": "this",
"predicate": { "predicate": {
"location": { "location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:the_end",
"position": { "position": {
"x": { "x": {
"min": 1000000.0 "min": 1000000.0
@ -52,7 +52,7 @@
"entity": "this", "entity": "this",
"predicate": { "predicate": {
"location": { "location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:the_end",
"position": { "position": {
"z": { "z": {
"min": 1000000.0 "min": 1000000.0
@ -85,10 +85,10 @@
"entity": "this", "entity": "this",
"predicate": { "predicate": {
"location": { "location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:the_end",
"position": { "position": {
"x": { "x": {
"min": -1000000.0 "max": -1000000.0
} }
} }
} }
@ -118,10 +118,10 @@
"entity": "this", "entity": "this",
"predicate": { "predicate": {
"location": { "location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:the_end",
"position": { "position": {
"x": { "x": {
"min": -1000000.0 "max": -1000000.0
} }
} }
} }

View File

@ -88,7 +88,7 @@
"dimension": "minecraft:the_end", "dimension": "minecraft:the_end",
"position": { "position": {
"x": { "x": {
"min": -100000.0 "max": -100000.0
} }
} }
} }
@ -121,7 +121,7 @@
"dimension": "minecraft:the_end", "dimension": "minecraft:the_end",
"position": { "position": {
"x": { "x": {
"min": -100000.0 "max": -100000.0
} }
} }
} }

View File

@ -10,49 +10,137 @@
}, },
"parent": "canopy:root", "parent": "canopy:root",
"criteria": { "criteria": {
"x+": { "outer_pos_x": {
"trigger": "minecraft:location", "trigger": "minecraft:location",
"conditions": { "conditions": {
"player": [{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:overworld",
"position": { "position": {
"x": { "x": {
"min": 31990 "min": 31990.0
}
} }
} }
} }
}, },
"x-": { {
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type_specific": {
"type": "player",
"gamemode": "spectator"
}
}
}
}
]
}
},
"outer_pos_z": {
"trigger": "minecraft:location", "trigger": "minecraft:location",
"conditions": { "conditions": {
"player": [{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"dimension": "minecraft:overworld",
"position": {
"z": {
"min": 31990.0
}
}
}
}
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type_specific": {
"type": "player",
"gamemode": "spectator"
}
}
}
}
]
}
},
"outer_neg_x": {
"trigger": "minecraft:location",
"conditions": {
"player": [{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:overworld",
"position": { "position": {
"x": { "x": {
"max": -31990 "max": -31990.0
}
} }
} }
} }
}, },
"z+": { {
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type_specific": {
"type": "player",
"gamemode": "spectator"
}
}
}
}
]
}
},
"outer_neg_z": {
"trigger": "minecraft:location", "trigger": "minecraft:location",
"conditions": { "conditions": {
"player": [{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"dimension": "minecraft:overworld", "dimension": "minecraft:overworld",
"position": { "position": {
"z": { "x": {
"min": 31990 "max": -31990.0
}
} }
} }
} }
}, },
"z-": { {
"trigger": "minecraft:location", "condition": "minecraft:inverted",
"conditions": { "term": {
"dimension": "minecraft:overworld", "condition": "minecraft:entity_properties",
"position": { "entity": "this",
"z": { "predicate": {
"max": -31990 "type_specific": {
"type": "player",
"gamemode": "spectator"
} }
} }
} }
} }
]
}
}
} }
} }

View File

@ -1,23 +0,0 @@
{
"display": {
"icon": {
"item": "minecraft:netherite_block"
},
"title": "What Is Wrong With You...",
"description": "Build a full beacon out of netherite blocks.",
"frame": "challenge",
"announce_to_chat": true
},
"parent": "canopy:root",
"criteria": {
"have_netherite": {
"trigger": "minecraft:inventory_changed",
"conditions": {
"items": [{
"item": "minecraft:netherite_block",
"count": 244
}]
}
}
}
}