CraftTweaker

CraftTweaker

151M Downloads

Specifying no NBT in input?

Ironmango21 opened this issue ยท 2 comments

commented

Issue Description:

I'm trying to create a crafting based enchanting system for a modpack, but have run into a slight hiccup. While I can use .onlywithtag to specify specific NBT for recipe inputs I can't seem to figure out how to do something similar for an item with no NBT tags. For example: I create two recipes, one for unbreaking I pick and another for an unbreaking II pick. The recipe for the unbreaking II pick specifies that it can only be crafted with an unbreaking I pick, but I can't figure out how to specify that the unbreaking I pick will only take an unenchanted pick.

What happens:

I can craft an unbreaking I pick with my current recipe, but when I try to craft an unbreaking II pick it assumes I'm trying to craft an unbreaking I pick again and gives me one as the crafting product.

What you expected to happen:

When a regular pick is used as the crafting ingredient a level I enchantment is returned, but when an already enchanted pick is used it returns the next level of enchantment.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://pastebin.com/PTirH6rm

Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

https://pastebin.com/DHw7NUe9


Affected Versions (Do not use "latest"):

  • Minecraft: 1.12
  • Forge: 14.23.2.2611
  • Crafttweaker: 4.1.5

Your most recent log file where the issue was present:

https://pastebin.com/DHw7NUe9

commented

Use

item.only(function(item){return !item.hasTag;})

Or if you need it multiple times, do

import crafttweaker.item.IItemCondition;

val noTagCondition as IItemCondition = function(item){return !item.hasTag;};

//For the recipes
item.only(noTagCondition);
commented

Worked perfectly! Thank you!