mojira.dev
MC-310316

Item modifier definition files can entirely be a string reference

The bug

JSON files in data/namespace/item_modifier can be simply JSON strings containing either an identifier of another item modifier, or a #-prefixed item modifier tag. If this identifier is the same as that of the file itself, it produces MC-310311.

It’s expected that the top-level of a datapack file only contains definitions, not references. Other resources do not allow this kind of “aliasing.”

How to reproduce

  1. Download and apply the attached data pack: [mediaInline]
    It contains an item modifier, test:test2, whose definition is simply "test:test".

  2. Run /item modify entity @s weapon test:test2

Expected results

The file should not load

Observed results

The file loads and is effectively an alias for test:test

Notes

After reporting, boq pointed out to me that this syntax is accepted because it’s a shorthand for {type:"sequence",functions:"test:test"}. So this may be intended. It could possibly be fixed by requiring sequence to accept a list, and not a single value.

Linked issues

Attachments

Comments 0

No comments.

tryashtar

Nathan Wolf

Confirmed

Platform HC

Data Packs

26.3 Snapshot 5

26.3 Snapshot 9

Retrieved