Skip to content

Commit

Permalink
Made Banana eatable
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshiy13 committed Oct 8, 2024
1 parent 198f09c commit 644abee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/main/java/dev/joshiy13/MoreFruits.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@ public void onInitialize() {
ModItems.registerModItems();
ModBlocks.registerModBlocks();
}

}
7 changes: 7 additions & 0 deletions src/main/java/dev/joshiy13/item/ModFoodComponents.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package dev.joshiy13.item;

import net.minecraft.component.type.FoodComponent;

public class ModFoodComponents {
public static final FoodComponent BANANA = new FoodComponent.Builder().nutrition(3).saturationModifier(0.25f).build();
}
4 changes: 1 addition & 3 deletions src/main/java/dev/joshiy13/item/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
public class ModItems {

//Fruits
public static final Item BANANA = registerItem("banana", new Item(new Item.Settings()));
public static final Item BANANA = registerItem("banana", new Item(new Item.Settings().food(ModFoodComponents.BANANA)));
//Berries


Expand All @@ -23,8 +23,6 @@ private static Item registerItem(String name, Item item) {
public static void registerModItems() {
MoreFruits.LOGGER.info("Registering Items for " + MoreFruits.MOD_ID);



ItemGroupEvents.modifyEntriesEvent(ItemGroups.FOOD_AND_DRINK).register(entries -> {
//Fruits
entries.add(BANANA);
Expand Down

0 comments on commit 644abee

Please sign in to comment.