mojira.dev
MC-310806

Predicate IDs in minecraft:all_of terms fail to resolve in enchantment effect requirements

Summary

Predicate IDs referenced in enchantment effect requirements fail to load with the error: Registry does not exist: minecraft:predicate

Description

According to the 26.3 Snapshot 4 changes, the terms field of minecraft:all_of accepts Predicate IDs.

However, when a Predicate ID is referenced from an enchantment effect's requirements, the enchantment fails to load and the world cannot be opened.

The same Predicate works correctly when evaluated using execute if predicate, so the issue appears to be specific to enchantment effect loading.

Steps

  1. Install the attached data pack.

  2. Create or open a world with the data pack enabled.

Expected Results

The enchantment loads successfully and evaluates the referenced Predicate ID.

Actual Results

The world fails to load due to a registry loading error.

Registry does not exist: minecraft:predicate

Additional Information

  • The attached data pack is a minimal reproduction.

  • The predicate test:random/1.0 works correctly with:

execute if predicate test:random/1.0 run say B
  • The predicate test:all/strings (which references test:random/1.0) also works correctly with:

execute if predicate test:all/strings run say C
  • The issue only occurs when the same Predicate ID is referenced inside an enchantment effect's requirements.


Error Log

[12:13:21] [Worker-Main-225/ERROR]: Registry loading errors:
> Errors in registry minecraft:enchantment:
>> Errors in element test:referenced:
java.lang.IllegalStateException: Failed to parse test:referenced from pack file/my_datapack
	at net.minecraft.resources.RegistryLoadTask$PendingRegistration.loadFromResource(RegistryLoadTask.java:111)
	at net.minecraft.resources.ResourceManagerRegistryLoadTask.lambda$load$2(ResourceManagerRegistryLoadTask.java:46)
	at net.minecraft.util.thread.ParallelMapTransform$Container.applyOperation(ParallelMapTransform.java:89)
	at net.minecraft.util.thread.ParallelMapTransform$SingleTaskSplitter.lambda$scheduleBatch$0(ParallelMapTransform.java:160)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1825)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1817)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:511)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1450)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:2019)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:187)
Caused by: java.lang.IllegalStateException: Failed to parse either. First: Not a tag id; Second: Failed to parse either. First: Not a json array: "test:random/1.0"; Second: Registry does not exist: minecraft:predicate missed input: {"minecraft:tick":[{"requirements":{"type":"minecraft:all_of","terms":"test:random/1.0"},"effect":{"type":"minecraft:run_function","function":"test:test"}}]}
	at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287)
	at com.mojang.serialization.DataResult.getOrThrow(DataResult.java:81)
	at net.minecraft.resources.RegistryLoadTask$PendingRegistration.loadFromResource(RegistryLoadTask.java:109)
	... 9 more

Attachments

Comments 3

Thank you for helping us improve Minecraft! We saved your files:

[media]

Your attached data pack does not contain a predicate called test:random/1.0 or an enchantment with any requirements. Still, I can confirm this behavior with a pack I made myself, and attached here: [mediaInline]

However, the 1.21-pre1 changelog says:

Unlike with loot tables, all effect conditions need to be inline objects and cannot be references.

Therefore this is intended

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version History – Snapshot Version History – The official Minecraft feedback site

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Harusame

(Unassigned)

Unconfirmed

26.3 Snapshot 7

Retrieved