Run /test as vanilla does in a world without test instances

Model TestCommand's release tree (ResourceSelectorArgument patterns
included) and its finder, locate, pos, stop and clear outcomes when no
test instance block exists. Compare /help's gamerule alternatives as a
set: GameRuleCommand registers them in identity-hash order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ludovic Marie
2026-10-11 16:47:42 +02:00
parent 38059ab9f9
commit 00371a7f35
9 changed files with 243 additions and 7 deletions
+14 -1
View File
@@ -838,6 +838,8 @@ def social():
def test_command():
# Horizon has no game test runner: `/test run|runmultiple|verify` of an
# existing instance and `/test create` are not compared.
return [
cmd('/test clearall'),
cmd('/test stop'),
@@ -847,7 +849,18 @@ def test_command():
cmd('/test resetclosest'),
cmd('/test runfailed'),
cmd('/test clearthese'),
cmd('/test verify minecraft:always_pass'),
cmd('/test runthese'),
cmd('/test runthat 2 true'),
cmd('/test runfailed true'),
cmd('/test resetthese'),
cmd('/test resetthat'),
cmd('/test clearthat'),
cmd('/test clearall 10'),
cmd('/test pos myPos'),
cmd('/test locate *'),
cmd('/test run minecraft:nothing*'),
cmd('/test locate nothing'),
cmd('/execute as @e[type=!minecraft:player,limit=1] run test pos'),
]