Skip to content

itemGetContainerItem function deletes the given item if the custom item is in stack of >1. #294

@GrandeMalum

Description

@GrandeMalum

Hello, dear developer. Unfortunately the itemGetContainerItem function is somewhat bugged. This example script works fine at first and loads without any issues, but as soon as the Milk Bowl gets placed in the crafting grid in a stack of more than one, then upon being used in a recipe the returning container item (minecraft:bowl) never appears in the inventory or never drops on the ground if the inventory is full. It just disappears.

#loader contenttweaker
import mods.contenttweaker.Item;
import mods.contenttweaker.VanillaFactory;
val milk_bowl = VanillaFactory.createItemFood("milk_bowl", 0);
milk_bowl.alwaysEdible = true;
milk_bowl.healAmount = 0;
milk_bowl.itemUseAction = "DRINK";
milk_bowl.maxStackSize = 16;
milk_bowl.saturation = 0.0;
milk_bowl.itemGetContainerItem = function(stack) {return <item:minecraft:bowl>;};
milk_bowl.register();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions