Skip to content

Ward command parity - #32

Merged
misode merged 2 commits into
misode:mainfrom
aksiome:ward-command-parity
Dec 1, 2026
Merged

misode merged 2 commits into
misode:mainfrom
aksiome:ward-command-parity

Conversation

@aksiome

@aksiome aksiome commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Backports two improvements from Ward:

  • Data assertion errors only show the part of the data the path reached, instead of the whole entity, block or storage data.
  • New dummy commands: drop from <slot> [all], mainhand <slot> and use as a short form of use item.

Before:

Expected data at a.b.d, found {a:{b:{c:1},list:[1,2]}, ...}

After:

Expected data at a.b.d, found {c:1} at a.b

mainhand <slot> does the same as selectslot <slot>, but counts from 0 to 8. Ward started with only mainhand, because I find 1 to 9 misleading next to how Minecraft numbers slots everywhere else (hotbar.0 to hotbar.8). Ward later added selectslot for compatibility with packtest, and this PR adds mainhand here so both commands exist in both mods. I personally think it would be best to deprecate selectslot in favour of mainhand, since its numbering is closer to what people expect in commands. What do you think?

@misode

misode commented Nov 27, 2026

Copy link
Copy Markdown
Owner

I feel a bit weird having both selectslot and mainhand with the only difference being whether they start counting from 0 or 9. It's true that the slot names are hotbar.0 - hotbar.8, but for players they keybinds are 1 - 9.

image

@aksiome

aksiome commented Nov 29, 2026

Copy link
Copy Markdown
Contributor Author

That's fair. Personally it feels a bit odd to have this kind of mismatch when writing commands:

item replace entity @s hotbar.0 with iron_sword
dummy @s selectslot 1
dummy @s attack @n[type=zombie]

I think this reads more naturally:

item replace entity @s hotbar.0 with iron_sword
dummy @s mainhand 0
dummy @s attack @n[type=zombie]

It's a mechanical change though, so if you don't think it fits, I can drop it from this PR. I'll probably keep both in my repo for parity.

@misode
misode merged commit bf07280 into misode:main Dec 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants