added food
Some checks failed
build / build (push) Has been cancelled

This commit is contained in:
Jottyfan
2025-11-25 17:33:07 +01:00
parent 367a48218f
commit 6f059abcce
8 changed files with 53 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package de.jottyfan.minecraft.item;
import net.minecraft.component.type.FoodComponent;
public enum Food {
GINGERBREAD(new FoodComponent.Builder()
.nutrition(1).saturationModifier(0.1f)
.build());
private final FoodComponent component;
private Food(FoodComponent component) {
this.component = component;
}
public FoodComponent get() {
return component;
}
}

View File

@@ -18,6 +18,9 @@ public class ModItems {
public static final Item RUBY = registerItem(
Identifier.of(Gtamfmd.MOD_ID, "ruby"), new Item.Settings());
public static final Item GINGERBREAD = registerItem(
Identifier.of(Gtamfmd.MOD_ID, "gingerbread"), new Item.Settings()
.food(Food.GINGERBREAD.get()));
private static Item registerStubItem(Identifier identifier, Settings settings) {
return Registry.register(Registries.ITEM, identifier, new StubItem(
@@ -38,6 +41,7 @@ public class ModItems {
.register(entries -> {
entries.add(STUB);
entries.add(RUBY);
entries.add(GINGERBREAD);
});
}
}

View File

@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "gtamfmd:item/gingerbread"
}
}

View File

@@ -1,4 +1,5 @@
{
"item.gtamfmd.gingerbread": "Lebkuchen",
"item.gtamfmd.stub": "Stummel",
"item.gtamfmd.ruby": "Rubin",
"item.gtamfmd.ruby_block": "Rubinblock",

View File

@@ -1,4 +1,5 @@
{
"item.gtamfmd.gingerbread": "Gingerbread",
"item.gtamfmd.stub": "Stub",
"item.gtamfmd.ruby": "Ruby",
"item.gtamfmd.ruby_block": "Ruby block",

View File

@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "gtamfmd:item/gingerbread"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@@ -0,0 +1,15 @@
{
"type": "minecraft:crafting_shaped",
"pattern": [
"# #",
"###",
" # "
],
"key": {
"#": "minecraft:wheat"
},
"result": {
"id": "gtamfmd:gingerbread",
"count": 1
}
}