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

@ -1,58 +1,146 @@
{ {
"display": { "display": {
"icon": { "icon": {
"item": "minecraft:spawner" "item": "minecraft:spawner"
}, },
"title": "Feeling Caged In", "title": "Feeling Caged In",
"description": "Find all four limits of the overworld cage. Don't worry, its a nice, big cage.", "description": "Find all four limits of the overworld cage. Don't worry, its a nice, big cage.",
"frame": "challenge", "frame": "challenge",
"announce_to_chat": true "announce_to_chat": true
}, },
"parent": "canopy:root", "parent": "canopy:root",
"criteria": { "criteria": {
"x+": { "outer_pos_x": {
"trigger": "minecraft:location", "trigger": "minecraft:location",
"conditions": { "conditions": {
"dimension": "minecraft:overworld", "player": [{
"position": { "condition": "minecraft:entity_properties",
"x": { "entity": "this",
"min": 31990 "predicate": {
} "location": {
} "dimension": "minecraft:overworld",
} "position": {
}, "x": {
"x-": { "min": 31990.0
"trigger": "minecraft:location", }
"conditions": { }
"dimension": "minecraft:overworld", }
"position": { }
"x": { },
"max": -31990 {
} "condition": "minecraft:inverted",
} "term": {
} "condition": "minecraft:entity_properties",
}, "entity": "this",
"z+": { "predicate": {
"trigger": "minecraft:location", "type_specific": {
"conditions": { "type": "player",
"dimension": "minecraft:overworld", "gamemode": "spectator"
"position": { }
"z": { }
"min": 31990 }
} }
} ]
} }
}, },
"z-": { "outer_pos_z": {
"trigger": "minecraft:location", "trigger": "minecraft:location",
"conditions": { "conditions": {
"dimension": "minecraft:overworld", "player": [{
"position": { "condition": "minecraft:entity_properties",
"z": { "entity": "this",
"max": -31990 "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",
"position": {
"x": {
"max": -31990.0
}
}
}
}
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"type_specific": {
"type": "player",
"gamemode": "spectator"
}
}
}
}
]
}
},
"outer_neg_z": {
"trigger": "minecraft:location",
"conditions": {
"player": [{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"dimension": "minecraft:overworld",
"position": {
"x": {
"max": -31990.0
}
}
}
}
},
{
"condition": "minecraft:inverted",
"term": {
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"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
}]
}
}
}
}