CraftTweaker

CraftTweaker

151M Downloads

Is it possible to refer to empty NBT tag?

Opened this issue ยท 3 comments

commented

I recently updated to the new version of Extra Utilities 2 that adds a bunch of new blocks and things, and i'd like to change the recipe for the machine block, but the problem is that the "machine block" and all of the generators have the same item name and meta with seperate NBT tags. Usually I would have no trouble with this, but the machine block has absolutely no NBT tag and I have no idea how to refer to it.

If I just do: val machine_block = extrautils2:Machine;
it will refer to the machine block and all of the generators as expected.

To refer to only the machine block with an empty tag i've tried all of the following but have gotten various errors each time.
val machine_block = extrautils2:Machine.withTag();
...withTag({});
...withTag(null);
...withTag{};
...withTag("");
...withTag({""});

Is it possible to check if a block has an empty tag?

commented

can you try something like

<minecraft:dirt>.tag

?

commented

That didn't seem to work unfortunately

commented

As far as I can tell, the withEmptyTag() doesn't seem to actually work... It's actually applying to itemstacks with NBT, not those without.

Example code:

<minecraft:potion>.withTag({Potion: "minecraft:water"}).addTooltip("Test 1");
<minecraft:potion>.withEmptyTag().addTooltip("Test 2");

In my case, the version with the tag received both tooltips. The other received neither.