#Get food item remainder

10 messages · Page 1 of 1 (latest)

amber wagon
#

in the farmer's delight (forge) code, here is how a bowl item is instantiated:


// ModItems.java
public static final RegistryObject<Item> SQUID_INK_PASTA = ITEMS.register("squid_ink_pasta", 
         () -> new ConsumableItem(bowlFoodItem(FoodValues.SQUID_INK_PASTA), true));

// tracing through the code
public static Item.Properties bowlFoodItem(FoodProperties food) { 
     return new Item.Properties().food(food)
          .craftRemainder(Items.BOWL).stacksTo(16)
          .tab(FarmersDelight.CREATIVE_TAB); 
 }

in KubeJS, how can i get the craftRemainder property for any given food item in the game?

north tigerBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

amber wagon
#

Get food item remainder

#

more specifically, i'm trying to extract this attribute so i can add recipe compat for a different mod:

#
ServerEvents.recipes((event) => {
    ['minecraft:water_bucket', 'minecraft:mushroom_soup', 'farmersdelight:squid_ink_pasta'].forEach((item) => {
        Ingredient.of(foodItem).stacks.toArray().forEach((itemstack) => {
            // Get item remainder and assign it to new recipes
        });
    });
});
#

i am confusion

#

lol

#

so i guess to be more specific

#

should i use java reflection here? or is there an easier way with kjs

amber wagon
#
ItemStack.getRecipeRemainder()