Rocky Tweaks

Rocky Tweaks

1M Downloads

Cannot set 0 as the cost for anvil reciipes

blahthebiste opened this issue ยท 3 comments

commented

This example script works fine:
Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 8, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}), 5);

However, simply changing the anvil recipe EXP cost to 0 creates a null pointer exception:
Anvil.addRecipe(<minecraft:book>, <minecraft:quartz> * 8, <minecraft:enchanted_book>.withTag({StoredEnchantments: [{lvl: 1 as short, id: 16 as short}]}), 0);

I am not sure if there is some reason this would not be supported, but I think it would be neat to use an anvil without spending XP.

Version:

Minecraft: 1.12.2
Forge: 14.23.5.2854
CraftTweaker: 1.12-4.1.20.660
MTlib: 3.0.7
RockyTweaks: 1.12.2-0.6.0-PRE-RELEASE-3

commented

The reason 0 cost is not supported is the underlying forge capability doesn't support it.

commented

Ah, unfortunate.

commented

It really was/is...