github.com/df-mc/dragonfly@v0.9.13/server/item/bread.go (about) 1 package item 2 3 import "github.com/df-mc/dragonfly/server/world" 4 5 // Bread is a food item that can be eaten by the player. 6 type Bread struct { 7 defaultFood 8 } 9 10 // Consume ... 11 func (Bread) Consume(_ *world.World, c Consumer) Stack { 12 c.Saturate(5, 6) 13 return Stack{} 14 } 15 16 // CompostChance ... 17 func (Bread) CompostChance() float64 { 18 return 0.85 19 } 20 21 // EncodeItem ... 22 func (Bread) EncodeItem() (name string, meta int16) { 23 return "minecraft:bread", 0 24 }