DevOnTheRocks / RockyTweaks

A Minecraft Forge mod that adds additional functionality to other mods.
GNU General Public License v3.0
5 stars 2 forks source link

Cannot set 0 as the cost for anvil reciipes #34

Closed blahthebiste closed 2 years ago

blahthebiste commented 2 years ago

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

Mohron commented 2 years ago

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

blahthebiste commented 2 years ago

Ah, unfortunate.

Mohron commented 2 years ago

It really was/is...