#an item loses durability when crafting instead of dissapearing
11 messages · Page 1 of 1 (latest)
or how do i make that item doesnt dissapear
so i kinda made trashcode but it works```kotlin
import beshenii.modding.FoodExtended.KNIFE
import net.minecraft.item.Item
class DebugOne(settings: Settings?) : Item(settings) {
override fun asItem(): Item {
return KNIFE
}
}```
var KNIFE: Item = Items.IRON_INGOT
DEBUG_ONE = register(DebugOne(FabricItemSettings()), "debug1", false)
KNIFE = register(SwordItem(ironMaterial, 2, -2.3f, FabricItemSettings().recipeRemainder(DEBUG_ONE)), "knife")```
isn't there a stack aware recipe remainder in FabricItemSettings
yes there's a nbt recipe remainder
I think you have to extend FabricItem and override recipeRemainder or something
yeah you're right but you shouldn't have to implement FabricItem cause that's interface injected
so just override FabricItem#getRecipeRemainder(ItemStack) in your Item class, or create an item class since it looks like you're using SwordItem
and just a heads up - don't do what you did with the DebugOne class, not only does it look strange and waste a bit of memory, it just flat out won't work if something doesn't use ItemConvertible#asItem()
is there a way i can make the knife lose durability when crafting?
ok i did it