mojira.dev
MC-186089

Functions load before entity tags do, causing loading errors.

The bug

Functions in data packs now load before entity tags. This causes errors when loading a data pack for the first time.

To reproduce:

  1. Download the attached datapack

[media]
  1. and place in the world file.

  2. /reload
    ❌ There is an error in the log stating there was an invalid entity.

    Failed to load function bug:error
    java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Invalid or unknown entity type 'bug:cat' at position 12: ...y @e[type=<--[HERE]
    	...
    Caused by: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Invalid or unknown entity type 'bug:cat' at position 12: ...y @e[type=<--[HERE]
    	...
  3. /reload one more time, and see that the error doesn't appear.

From this, we can conclude that the function is loading before the tag, as if the tag was invalid, it would be invalid in the function the second time. However, the second time it is not invalid, so therefore it must have been loaded.

Linked issues

Attachments

Comments 2

After some testing it appears that this affects all data pack tags. The problem is not that they load after function, they aren't loaded at all initially (on world join or /datapack enable). They are only loaded on a /reload.

MC-186478, which may be a duplicate, describes this behavior.

I can confirm this in multiplayer too, whenever the server is restarted the datapacks need to be reloaded using commands, they aren't working by default anymore.

Edit: The part of our datapack that changes the blocks endermen can pick up doesn't work even after using /reload. The rest of the datapack still works. Everything worked fine in the previous snapshots.

CreeperMagnet_

boq

Confirmed

Very Important

Data Packs

20w22a

1.16 Pre-release 1

Retrieved