Skip to content

Commit

Permalink
(Roasted) Coffee Beans can now be eaten
Browse files Browse the repository at this point in the history
  • Loading branch information
pluto7073 committed Apr 10, 2022
1 parent e0ed056 commit 148d8b8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/main/java/ml/pluto7073/plutoscoffee/items/CoffeeBean.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
package ml.pluto7073.plutoscoffee.items;

import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.entity.effect.StatusEffects;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;

public class CoffeeBean extends Item{
public class CoffeeBean extends Item {

public static FoodComponent.Builder COFFEE_BEAN_FOOD_COMPONENT = new FoodComponent.Builder()
.snack()
.alwaysEdible()
.hunger(1)
.saturationModifier(0.5f)
.statusEffect(new StatusEffectInstance(StatusEffects.SPEED, 20 * 10), 1)
.statusEffect(new StatusEffectInstance(StatusEffects.JUMP_BOOST, 20 * 10), 1)
.statusEffect(new StatusEffectInstance(StatusEffects.HASTE, 20 * 10), 1);

public CoffeeBean() {
super(new Item.Settings().group(ItemGroup.FOOD));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
public class CoffeeBeanRoasted extends Item {

public CoffeeBeanRoasted() {
super(new Item.Settings().group(ItemGroup.FOOD));
super(new Item.Settings().group(ItemGroup.FOOD).food(CoffeeBean.COFFEE_BEAN_FOOD_COMPONENT.build()));
}

}

0 comments on commit 148d8b8

Please sign in to comment.