github.com/df-mc/dragonfly@v0.9.13/server/item/pufferfish.go (about)

     1  package item
     2  
     3  import (
     4  	"github.com/df-mc/dragonfly/server/entity/effect"
     5  	"github.com/df-mc/dragonfly/server/world"
     6  	"time"
     7  )
     8  
     9  // Pufferfish is a poisonous type of fish that is used to brew water breathing potions.
    10  type Pufferfish struct {
    11  	defaultFood
    12  }
    13  
    14  // Consume ...
    15  func (p Pufferfish) Consume(_ *world.World, c Consumer) Stack {
    16  	c.Saturate(1, 0.2)
    17  	c.AddEffect(effect.New(effect.Hunger{}, 3, 15*time.Second))
    18  	c.AddEffect(effect.New(effect.Poison{}, 2, time.Minute))
    19  	c.AddEffect(effect.New(effect.Nausea{}, 2, 15*time.Second))
    20  	return Stack{}
    21  }
    22  
    23  // EncodeItem ...
    24  func (p Pufferfish) EncodeItem() (name string, meta int16) {
    25  	return "minecraft:pufferfish", 0
    26  }