You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a mod with several variants on fences, and it uses a block tag mod:fences (with a different namespace, of course, that I don't want to spoil here). It is a tag referring to all fences of all types, not just vanilla fences. So, it should contain an entry #minecraft:fences. Since I didn't add any blocks to minecraft:fences, the TagProvider then believes that the tag minecraft:fences does not exist, and throws an exception.
// (mojmaps!!!)@OverrideprotectedvoidaddTags(HolderLookup.Providerprovider) {
// other tags...// This call returns, but the generator will throw an exception later because of thistag(ModBlockTags.FENCES).addTag(BlockTags.FENCES);
}
Upon running the data generator, this generates an IllegalArgumentException saying Couldn't define tag marl:fences as it is missing following references: #minecraft:fences.
A workaround is to create a tag builder for the vanilla tag simply by calling tag(BlockTags.FENCES) (as well as tag(ItemTags.FENCES) if you copy the block tag to an item tag). This is pretty unintuitive.
The problem lays in the vanilla TagsProvider. It supports providing a parent TagLookup, which could be provided by the generator for vanilla tags (such as VanillaBlockTagsProvider). Providing such a parent is currently unsupported by the Data Generation API.
The text was updated successfully, but these errors were encountered:
FoxSamu
changed the title
Data generation: Adding a vanilla tag to a modded tag without also adding entries to that vanilla tag causes an exception
Data generation: Adding a vanilla tag to a modded tag without also creating a builder for that vanilla tag causes an exception
Jan 8, 2025
I am working on a mod with several variants on fences, and it uses a block tag
mod:fences
(with a different namespace, of course, that I don't want to spoil here). It is a tag referring to all fences of all types, not just vanilla fences. So, it should contain an entry#minecraft:fences
. Since I didn't add any blocks tominecraft:fences
, theTagProvider
then believes that the tagminecraft:fences
does not exist, and throws an exception.Upon running the data generator, this generates an
IllegalArgumentException
sayingCouldn't define tag marl:fences as it is missing following references: #minecraft:fences
.A workaround is to create a tag builder for the vanilla tag simply by calling
tag(BlockTags.FENCES)
(as well astag(ItemTags.FENCES)
if you copy the block tag to an item tag). This is pretty unintuitive.The problem lays in the vanilla
TagsProvider
. It supports providing a parentTagLookup
, which could be provided by the generator for vanilla tags (such asVanillaBlockTagsProvider
). Providing such a parent is currently unsupported by the Data Generation API.The text was updated successfully, but these errors were encountered: