#Where is the default components for each item defined?
4 messages · Page 1 of 1 (latest)
There must be default components for each items
For example, /give @s stone will give you a stone (not edible, obviously)
But /give @s cooked_beef will be edible, unless you type /give @s cooked_beef[!food]
Which means the food component is defined somewhere
So whenever a cooked beef appears (smelting, chest loots, /give, etc), it is defaultly edible
DefaultItemComponentEvents.MODIFY.register((modifyContext) -> {
modifyContext.modify(Items.EGG, (builder) -> {
builder.add(DataComponentTypes.FOOD, new FoodComponent(10,10,true));
});
});
That causes a desync between client and server, so the eating animation disappears (my mod is designed to work on the server side...)