item

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConsumeDuration = (time.Second * 161) / 100

Variables

View Source
var (
	EnchantmentRarityCommon enchantmentRarityCommon

	EnchantmentRarityUncommon enchantmentRarityUncommon

	EnchantmentRarityRare enchantmentRarityRare

	EnchantmentRarityVeryRare enchantmentRarityVeryRare
)
View Source
var (
	TypeNone = ToolType{-1}

	TypePickaxe = ToolType{0}

	TypeAxe = ToolType{1}

	TypeHoe = ToolType{2}

	TypeShovel = ToolType{3}

	TypeShears = ToolType{4}

	TypeSword = ToolType{5}

	ToolTierWood = ToolTier{HarvestLevel: 1, Durability: 59, BaseMiningEfficiency: 2, BaseAttackDamage: 1, EnchantmentValue: 15, Name: "wooden"}

	ToolTierGold = ToolTier{HarvestLevel: 1, Durability: 32, BaseMiningEfficiency: 12, BaseAttackDamage: 1, EnchantmentValue: 22, Name: "golden"}

	ToolTierStone = ToolTier{HarvestLevel: 2, Durability: 131, BaseMiningEfficiency: 4, BaseAttackDamage: 2, EnchantmentValue: 5, Name: "stone"}

	ToolTierCopper = ToolTier{HarvestLevel: 2, Durability: 190, BaseMiningEfficiency: 5, BaseAttackDamage: 2, EnchantmentValue: 13, Name: "copper"}

	ToolTierIron = ToolTier{HarvestLevel: 3, Durability: 250, BaseMiningEfficiency: 6, BaseAttackDamage: 3, EnchantmentValue: 14, Name: "iron"}

	ToolTierDiamond = ToolTier{HarvestLevel: 4, Durability: 1561, BaseMiningEfficiency: 8, BaseAttackDamage: 4, EnchantmentValue: 10, Name: "diamond"}

	ToolTierNetherite = ToolTier{HarvestLevel: 4, Durability: 2031, BaseMiningEfficiency: 9, BaseAttackDamage: 5, EnchantmentValue: 15, Name: "netherite"}
)

Functions

func ArmourTrimMaterials

func ArmourTrimMaterials() []world.Item

func EnchantmentID

func EnchantmentID(e EnchantmentType) (int, bool)

func RegisterEnchantment

func RegisterEnchantment(id int, enchantment EnchantmentType)

Types

type AmethystShard

type AmethystShard struct{}

func (AmethystShard) EncodeItem

func (AmethystShard) EncodeItem() (name string, meta int16)

func (AmethystShard) MaterialColour

func (AmethystShard) MaterialColour() string

func (AmethystShard) TrimMaterial

func (AmethystShard) TrimMaterial() string

type Apple

type Apple struct {
	// contains filtered or unexported fields
}

func (Apple) AlwaysConsumable

func (Apple) AlwaysConsumable() bool

func (Apple) CompostChance

func (Apple) CompostChance() float64

func (Apple) Consume

func (a Apple) Consume(_ *world.Tx, c Consumer) Stack

func (Apple) ConsumeDuration

func (d Apple) ConsumeDuration() time.Duration

func (Apple) EncodeItem

func (a Apple) EncodeItem() (name string, meta int16)

type Armour

type Armour interface {
	DefencePoints() float64

	Toughness() float64

	KnockBackResistance() float64
}

type ArmourTier

type ArmourTier interface {
	BaseDurability() float64

	Toughness() float64

	KnockBackResistance() float64

	EnchantmentValue() int

	Name() string
}

func ArmourTiers

func ArmourTiers() []ArmourTier

type ArmourTierChain

type ArmourTierChain struct{}

func (ArmourTierChain) BaseDurability

func (ArmourTierChain) BaseDurability() float64

func (ArmourTierChain) EnchantmentValue

func (ArmourTierChain) EnchantmentValue() int

func (ArmourTierChain) KnockBackResistance

func (ArmourTierChain) KnockBackResistance() float64

func (ArmourTierChain) Name

func (ArmourTierChain) Name() string

func (ArmourTierChain) Toughness

func (ArmourTierChain) Toughness() float64

type ArmourTierCopper

type ArmourTierCopper struct{}

func (ArmourTierCopper) BaseDurability

func (ArmourTierCopper) BaseDurability() float64

func (ArmourTierCopper) EnchantmentValue

func (ArmourTierCopper) EnchantmentValue() int

func (ArmourTierCopper) KnockBackResistance

func (ArmourTierCopper) KnockBackResistance() float64

func (ArmourTierCopper) Name

func (ArmourTierCopper) Name() string

func (ArmourTierCopper) Toughness

func (ArmourTierCopper) Toughness() float64

type ArmourTierDiamond

type ArmourTierDiamond struct{}

func (ArmourTierDiamond) BaseDurability

func (ArmourTierDiamond) BaseDurability() float64

func (ArmourTierDiamond) EnchantmentValue

func (ArmourTierDiamond) EnchantmentValue() int

func (ArmourTierDiamond) KnockBackResistance

func (ArmourTierDiamond) KnockBackResistance() float64

func (ArmourTierDiamond) Name

func (ArmourTierDiamond) Name() string

func (ArmourTierDiamond) Toughness

func (ArmourTierDiamond) Toughness() float64

type ArmourTierGold

type ArmourTierGold struct{}

func (ArmourTierGold) BaseDurability

func (ArmourTierGold) BaseDurability() float64

func (ArmourTierGold) EnchantmentValue

func (ArmourTierGold) EnchantmentValue() int

func (ArmourTierGold) KnockBackResistance

func (ArmourTierGold) KnockBackResistance() float64

func (ArmourTierGold) Name

func (ArmourTierGold) Name() string

func (ArmourTierGold) Toughness

func (ArmourTierGold) Toughness() float64

type ArmourTierIron

type ArmourTierIron struct{}

func (ArmourTierIron) BaseDurability

func (ArmourTierIron) BaseDurability() float64

func (ArmourTierIron) EnchantmentValue

func (ArmourTierIron) EnchantmentValue() int

func (ArmourTierIron) KnockBackResistance

func (ArmourTierIron) KnockBackResistance() float64

func (ArmourTierIron) Name

func (ArmourTierIron) Name() string

func (ArmourTierIron) Toughness

func (ArmourTierIron) Toughness() float64

type ArmourTierLeather

type ArmourTierLeather struct {
	Colour color.RGBA
}

func (ArmourTierLeather) BaseDurability

func (ArmourTierLeather) BaseDurability() float64

func (ArmourTierLeather) EnchantmentValue

func (ArmourTierLeather) EnchantmentValue() int

func (ArmourTierLeather) KnockBackResistance

func (ArmourTierLeather) KnockBackResistance() float64

func (ArmourTierLeather) Name

func (ArmourTierLeather) Name() string

func (ArmourTierLeather) Toughness

func (ArmourTierLeather) Toughness() float64

type ArmourTierNetherite

type ArmourTierNetherite struct{}

func (ArmourTierNetherite) BaseDurability

func (ArmourTierNetherite) BaseDurability() float64

func (ArmourTierNetherite) EnchantmentValue

func (ArmourTierNetherite) EnchantmentValue() int

func (ArmourTierNetherite) KnockBackResistance

func (ArmourTierNetherite) KnockBackResistance() float64

func (ArmourTierNetherite) Name

func (ArmourTierNetherite) Name() string

func (ArmourTierNetherite) Toughness

func (ArmourTierNetherite) Toughness() float64

type ArmourTrim

type ArmourTrim struct {
	Template SmithingTemplateType
	Material ArmourTrimMaterial
}

func (ArmourTrim) Zero

func (trim ArmourTrim) Zero() bool

type ArmourTrimMaterial

type ArmourTrimMaterial interface {
	TrimMaterial() string

	MaterialColour() string
}

type Arrow

type Arrow struct {
	Tip potion.Potion
}

func (Arrow) EncodeItem

func (a Arrow) EncodeItem() (name string, meta int16)

func (Arrow) OffHand

func (Arrow) OffHand() bool

type Axe

type Axe struct {
	Tier ToolTier
}

func (Axe) AttackDamage

func (a Axe) AttackDamage() float64

func (Axe) BaseMiningEfficiency

func (a Axe) BaseMiningEfficiency(world.Block) float64

func (Axe) DurabilityInfo

func (a Axe) DurabilityInfo() DurabilityInfo

func (Axe) EnchantmentValue

func (a Axe) EnchantmentValue() int

func (Axe) EncodeItem

func (a Axe) EncodeItem() (name string, meta int16)

func (Axe) FuelInfo

func (a Axe) FuelInfo() FuelInfo

func (Axe) HarvestLevel

func (a Axe) HarvestLevel() int

func (Axe) MaxCount

func (a Axe) MaxCount() int

func (Axe) RepairableBy

func (a Axe) RepairableBy(i Stack) bool

func (Axe) SmeltInfo

func (a Axe) SmeltInfo() SmeltInfo

func (Axe) ToolType

func (a Axe) ToolType() ToolType

func (Axe) UseOnBlock

func (a Axe) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type BakedPotato

type BakedPotato struct {
	// contains filtered or unexported fields
}

func (BakedPotato) AlwaysConsumable

func (BakedPotato) AlwaysConsumable() bool

func (BakedPotato) CompostChance

func (BakedPotato) CompostChance() float64

func (BakedPotato) Consume

func (BakedPotato) Consume(_ *world.Tx, c Consumer) Stack

func (BakedPotato) ConsumeDuration

func (d BakedPotato) ConsumeDuration() time.Duration

func (BakedPotato) EncodeItem

func (BakedPotato) EncodeItem() (name string, meta int16)

type BannerPattern

type BannerPattern struct {
	Type BannerPatternType
}

func (BannerPattern) EncodeItem

func (b BannerPattern) EncodeItem() (name string, meta int16)

func (BannerPattern) MaxCount

func (b BannerPattern) MaxCount() int

type BannerPatternType

type BannerPatternType struct {
	// contains filtered or unexported fields
}

func BannerPatterns

func BannerPatterns() []BannerPatternType

func BordureIndentedBannerPattern

func BordureIndentedBannerPattern() BannerPatternType

func CreeperBannerPattern

func CreeperBannerPattern() BannerPatternType

func FieldMasonedBannerPattern

func FieldMasonedBannerPattern() BannerPatternType

func FlowBannerPattern

func FlowBannerPattern() BannerPatternType

func FlowerBannerPattern

func FlowerBannerPattern() BannerPatternType

func GlobeBannerPattern

func GlobeBannerPattern() BannerPatternType

func GusterBannerPattern

func GusterBannerPattern() BannerPatternType

func MojangBannerPattern

func MojangBannerPattern() BannerPatternType

func PiglinBannerPattern

func PiglinBannerPattern() BannerPatternType

func SkullBannerPattern

func SkullBannerPattern() BannerPatternType

func (BannerPatternType) String

func (b BannerPatternType) String() string

func (BannerPatternType) Uint8

func (b BannerPatternType) Uint8() uint8

type BeaconPayment

type BeaconPayment interface {
	PayableForBeacon() bool
}

type Beef

type Beef struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Beef) AlwaysConsumable

func (Beef) AlwaysConsumable() bool

func (Beef) Consume

func (b Beef) Consume(_ *world.Tx, c Consumer) Stack

func (Beef) ConsumeDuration

func (d Beef) ConsumeDuration() time.Duration

func (Beef) EncodeItem

func (b Beef) EncodeItem() (name string, meta int16)

func (Beef) SmeltInfo

func (b Beef) SmeltInfo() SmeltInfo

type Beetroot

type Beetroot struct {
	// contains filtered or unexported fields
}

func (Beetroot) AlwaysConsumable

func (Beetroot) AlwaysConsumable() bool

func (Beetroot) CompostChance

func (Beetroot) CompostChance() float64

func (Beetroot) Consume

func (b Beetroot) Consume(_ *world.Tx, c Consumer) Stack

func (Beetroot) ConsumeDuration

func (d Beetroot) ConsumeDuration() time.Duration

func (Beetroot) EncodeItem

func (b Beetroot) EncodeItem() (name string, meta int16)

type BeetrootSoup

type BeetrootSoup struct {
	// contains filtered or unexported fields
}

func (BeetrootSoup) AlwaysConsumable

func (BeetrootSoup) AlwaysConsumable() bool

func (BeetrootSoup) Consume

func (BeetrootSoup) Consume(_ *world.Tx, c Consumer) Stack

func (BeetrootSoup) ConsumeDuration

func (d BeetrootSoup) ConsumeDuration() time.Duration

func (BeetrootSoup) EncodeItem

func (BeetrootSoup) EncodeItem() (name string, meta int16)

func (BeetrootSoup) MaxCount

func (BeetrootSoup) MaxCount() int

type BlazePowder

type BlazePowder struct{}

func (BlazePowder) EncodeItem

func (BlazePowder) EncodeItem() (name string, meta int16)

type BlazeRod

type BlazeRod struct{}

func (BlazeRod) EncodeItem

func (BlazeRod) EncodeItem() (name string, meta int16)

func (BlazeRod) FuelInfo

func (BlazeRod) FuelInfo() FuelInfo

type Bone

type Bone struct{}

func (Bone) EncodeItem

func (Bone) EncodeItem() (name string, meta int16)

type BoneMeal

type BoneMeal struct{}

func (BoneMeal) EncodeItem

func (b BoneMeal) EncodeItem() (name string, meta int16)

func (BoneMeal) UseOnBlock

func (b BoneMeal) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type BoneMealAffected

type BoneMealAffected interface {
	BoneMeal(pos cube.Pos, tx *world.Tx) BoneMealResult
}

type BoneMealResult

type BoneMealResult int
const (
	BoneMealResultNone BoneMealResult = iota

	BoneMealResultSmall

	BoneMealResultArea
)

type Book

type Book struct{}

func (Book) EnchantmentValue

func (b Book) EnchantmentValue() int

func (Book) EncodeItem

func (Book) EncodeItem() (name string, meta int16)

type BookAndQuill

type BookAndQuill struct {
	Pages []string
}

func (BookAndQuill) DecodeNBT

func (b BookAndQuill) DecodeNBT(data map[string]any) any

func (BookAndQuill) DeletePage

func (b BookAndQuill) DeletePage(page int) BookAndQuill

func (BookAndQuill) EncodeItem

func (BookAndQuill) EncodeItem() (name string, meta int16)

func (BookAndQuill) EncodeNBT

func (b BookAndQuill) EncodeNBT() map[string]any

func (BookAndQuill) InsertPage

func (b BookAndQuill) InsertPage(page int, text string) BookAndQuill

func (BookAndQuill) MaxCount

func (BookAndQuill) MaxCount() int

func (BookAndQuill) Page

func (b BookAndQuill) Page(page int) (string, bool)

func (BookAndQuill) SetPage

func (b BookAndQuill) SetPage(page int, text string) BookAndQuill

func (BookAndQuill) SwapPages

func (b BookAndQuill) SwapPages(pageOne, pageTwo int) BookAndQuill

func (BookAndQuill) TotalPages

func (b BookAndQuill) TotalPages() int

type Boots

type Boots struct {
	Tier ArmourTier

	Trim ArmourTrim
}

func (Boots) Boots

func (b Boots) Boots() bool

func (Boots) DecodeNBT

func (b Boots) DecodeNBT(data map[string]any) any

func (Boots) DefencePoints

func (b Boots) DefencePoints() float64

func (Boots) DurabilityInfo

func (b Boots) DurabilityInfo() DurabilityInfo

func (Boots) EnchantmentValue

func (b Boots) EnchantmentValue() int

func (Boots) EncodeItem

func (b Boots) EncodeItem() (name string, meta int16)

func (Boots) EncodeNBT

func (b Boots) EncodeNBT() map[string]any

func (Boots) KnockBackResistance

func (b Boots) KnockBackResistance() float64

func (Boots) MaxCount

func (b Boots) MaxCount() int

func (Boots) RepairableBy

func (b Boots) RepairableBy(i Stack) bool

func (Boots) SmeltInfo

func (b Boots) SmeltInfo() SmeltInfo

func (Boots) Toughness

func (b Boots) Toughness() float64

func (Boots) Use

func (b Boots) Use(_ *world.Tx, _ User, ctx *UseContext) bool

func (Boots) WithTrim

func (b Boots) WithTrim(trim ArmourTrim) world.Item

type BootsType

type BootsType interface {
	Armour
	Boots() bool
}

type BottleOfEnchanting

type BottleOfEnchanting struct{}

func (BottleOfEnchanting) EncodeItem

func (b BottleOfEnchanting) EncodeItem() (name string, meta int16)

func (BottleOfEnchanting) Use

func (b BottleOfEnchanting) Use(tx *world.Tx, user User, ctx *UseContext) bool

type Bow

type Bow struct{}

func (Bow) DurabilityInfo

func (Bow) DurabilityInfo() DurabilityInfo

func (Bow) EnchantmentValue

func (Bow) EnchantmentValue() int

func (Bow) EncodeItem

func (Bow) EncodeItem() (name string, meta int16)

func (Bow) FuelInfo

func (Bow) FuelInfo() FuelInfo

func (Bow) MaxCount

func (Bow) MaxCount() int

func (Bow) Release

func (Bow) Release(releaser Releaser, tx *world.Tx, ctx *UseContext, duration time.Duration)

func (Bow) Requirements

func (Bow) Requirements() []Stack

type Bowl

type Bowl struct{}

func (Bowl) EncodeItem

func (Bowl) EncodeItem() (name string, meta int16)

func (Bowl) FuelInfo

func (Bowl) FuelInfo() FuelInfo

type Bread

type Bread struct {
	// contains filtered or unexported fields
}

func (Bread) AlwaysConsumable

func (Bread) AlwaysConsumable() bool

func (Bread) CompostChance

func (Bread) CompostChance() float64

func (Bread) Consume

func (Bread) Consume(_ *world.Tx, c Consumer) Stack

func (Bread) ConsumeDuration

func (d Bread) ConsumeDuration() time.Duration

func (Bread) EncodeItem

func (Bread) EncodeItem() (name string, meta int16)

type Brick

type Brick struct{}

func (Brick) EncodeItem

func (b Brick) EncodeItem() (name string, meta int16)

func (Brick) PotDecoration

func (Brick) PotDecoration() bool

type Bucket

type Bucket struct {
	Content BucketContent
}

func (Bucket) AlwaysConsumable

func (b Bucket) AlwaysConsumable() bool

func (Bucket) CanConsume

func (b Bucket) CanConsume() bool

func (Bucket) Consume

func (b Bucket) Consume(_ *world.Tx, c Consumer) Stack

func (Bucket) ConsumeDuration

func (b Bucket) ConsumeDuration() time.Duration

func (Bucket) Empty

func (b Bucket) Empty() bool

func (Bucket) EncodeItem

func (b Bucket) EncodeItem() (name string, meta int16)

func (Bucket) FuelInfo

func (b Bucket) FuelInfo() FuelInfo

func (Bucket) MaxCount

func (b Bucket) MaxCount() int

func (Bucket) UseOnBlock

func (b Bucket) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type BucketContent

type BucketContent struct {
	// contains filtered or unexported fields
}

func LiquidBucketContent

func LiquidBucketContent(l world.Liquid) BucketContent

func MilkBucketContent

func MilkBucketContent() BucketContent

func (BucketContent) Liquid

func (b BucketContent) Liquid() (world.Liquid, bool)

func (BucketContent) LiquidType

func (b BucketContent) LiquidType() string

func (BucketContent) String

func (b BucketContent) String() string

type Carrier

type Carrier interface {
	world.Entity

	HeldItems() (mainHand, offHand Stack)
}

type CarrotOnAStick

type CarrotOnAStick struct{}

func (CarrotOnAStick) EncodeItem

func (CarrotOnAStick) EncodeItem() (name string, meta int16)

func (CarrotOnAStick) MaxCount

func (CarrotOnAStick) MaxCount() int

type Charcoal

type Charcoal struct{}

func (Charcoal) EncodeItem

func (Charcoal) EncodeItem() (name string, meta int16)

func (Charcoal) FuelInfo

func (Charcoal) FuelInfo() FuelInfo

type Chargeable

type Chargeable interface {
	Charge(releaser Releaser, tx *world.Tx, ctx *UseContext, duration time.Duration) bool

	ContinueCharge(releaser Releaser, tx *world.Tx, ctx *UseContext, duration time.Duration)

	ReleaseCharge(releaser Releaser, tx *world.Tx, ctx *UseContext) bool

	CanCharge(releaser Releaser, tx *world.Tx, ctx *UseContext) bool
}

type Chestplate

type Chestplate struct {
	Tier ArmourTier

	Trim ArmourTrim
}

func (Chestplate) Chestplate

func (c Chestplate) Chestplate() bool

func (Chestplate) DecodeNBT

func (c Chestplate) DecodeNBT(data map[string]any) any

func (Chestplate) DefencePoints

func (c Chestplate) DefencePoints() float64

func (Chestplate) DurabilityInfo

func (c Chestplate) DurabilityInfo() DurabilityInfo

func (Chestplate) EnchantmentValue

func (c Chestplate) EnchantmentValue() int

func (Chestplate) EncodeItem

func (c Chestplate) EncodeItem() (name string, meta int16)

func (Chestplate) EncodeNBT

func (c Chestplate) EncodeNBT() map[string]any

func (Chestplate) KnockBackResistance

func (c Chestplate) KnockBackResistance() float64

func (Chestplate) MaxCount

func (c Chestplate) MaxCount() int

func (Chestplate) RepairableBy

func (c Chestplate) RepairableBy(i Stack) bool

func (Chestplate) SmeltInfo

func (c Chestplate) SmeltInfo() SmeltInfo

func (Chestplate) Toughness

func (c Chestplate) Toughness() float64

func (Chestplate) Use

func (c Chestplate) Use(_ *world.Tx, _ User, ctx *UseContext) bool

func (Chestplate) WithTrim

func (c Chestplate) WithTrim(trim ArmourTrim) world.Item

type ChestplateType

type ChestplateType interface {
	Armour
	Chestplate() bool
}

type Chicken

type Chicken struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Chicken) AlwaysConsumable

func (Chicken) AlwaysConsumable() bool

func (Chicken) Consume

func (c Chicken) Consume(_ *world.Tx, co Consumer) Stack

func (Chicken) ConsumeDuration

func (d Chicken) ConsumeDuration() time.Duration

func (Chicken) EncodeItem

func (c Chicken) EncodeItem() (name string, meta int16)

func (Chicken) SmeltInfo

func (c Chicken) SmeltInfo() SmeltInfo

type ClayBall

type ClayBall struct{}

func (ClayBall) EncodeItem

func (ClayBall) EncodeItem() (name string, meta int16)

func (ClayBall) SmeltInfo

func (ClayBall) SmeltInfo() SmeltInfo

type Clock

type Clock struct{}

func (Clock) EncodeItem

func (w Clock) EncodeItem() (name string, meta int16)

type Coal

type Coal struct{}

func (Coal) EncodeItem

func (Coal) EncodeItem() (name string, meta int16)

func (Coal) FuelInfo

func (Coal) FuelInfo() FuelInfo

type Cod

type Cod struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Cod) AlwaysConsumable

func (Cod) AlwaysConsumable() bool

func (Cod) Consume

func (c Cod) Consume(_ *world.Tx, co Consumer) Stack

func (Cod) ConsumeDuration

func (d Cod) ConsumeDuration() time.Duration

func (Cod) EncodeItem

func (c Cod) EncodeItem() (name string, meta int16)

func (Cod) SmeltInfo

func (c Cod) SmeltInfo() SmeltInfo

type Colour

type Colour struct {
	// contains filtered or unexported fields
}

func ColourBlack

func ColourBlack() Colour

func ColourBlue

func ColourBlue() Colour

func ColourBrown

func ColourBrown() Colour

func ColourCyan

func ColourCyan() Colour

func ColourGreen

func ColourGreen() Colour

func ColourGrey

func ColourGrey() Colour

func ColourLightBlue

func ColourLightBlue() Colour

func ColourLightGrey

func ColourLightGrey() Colour

func ColourLime

func ColourLime() Colour

func ColourMagenta

func ColourMagenta() Colour

func ColourOrange

func ColourOrange() Colour

func ColourPink

func ColourPink() Colour

func ColourPurple

func ColourPurple() Colour

func ColourRed

func ColourRed() Colour

func ColourWhite

func ColourWhite() Colour

func ColourYellow

func ColourYellow() Colour

func Colours

func Colours() []Colour

func (Colour) RGBA

func (c Colour) RGBA() color.RGBA

func (Colour) SignRGBA

func (c Colour) SignRGBA() color.RGBA

func (Colour) SilverString

func (c Colour) SilverString() string

func (Colour) String

func (c Colour) String() string

func (Colour) Uint8

func (c Colour) Uint8() uint8

type Compass

type Compass struct{}

func (Compass) EncodeItem

func (Compass) EncodeItem() (name string, meta int16)

type Compostable

type Compostable interface {
	CompostChance() float64
}

type Consumable

type Consumable interface {
	AlwaysConsumable() bool

	ConsumeDuration() time.Duration

	Consume(tx *world.Tx, c Consumer) Stack
}

type Consumer

type Consumer interface {
	User

	Saturate(food int, saturation float64)

	AddEffect(e effect.Effect)

	RemoveEffect(e effect.Type)

	Effects() []effect.Effect

	Absorption() float64

	SetAbsorption(health float64)
}
type Cookie struct {
	// contains filtered or unexported fields
}

func (Cookie) AlwaysConsumable

func (Cookie) AlwaysConsumable() bool

func (Cookie) CompostChance

func (Cookie) CompostChance() float64

func (Cookie) Consume

func (Cookie) Consume(_ *world.Tx, c Consumer) Stack

func (Cookie) ConsumeDuration

func (d Cookie) ConsumeDuration() time.Duration

func (Cookie) EncodeItem

func (Cookie) EncodeItem() (name string, meta int16)

type Cooldown

type Cooldown interface {
	Cooldown() time.Duration
}

type CopperIngot

type CopperIngot struct{}

func (CopperIngot) EncodeItem

func (c CopperIngot) EncodeItem() (name string, meta int16)

func (CopperIngot) MaterialColour

func (CopperIngot) MaterialColour() string

func (CopperIngot) TrimMaterial

func (CopperIngot) TrimMaterial() string

type CopperNugget

type CopperNugget struct{}

func (CopperNugget) EncodeItem

func (CopperNugget) EncodeItem() (name string, meta int16)

type Crossbow

type Crossbow struct {
	Item Stack
}

func (Crossbow) CanCharge

func (c Crossbow) CanCharge(releaser Releaser, _ *world.Tx, ctx *UseContext) bool

func (Crossbow) Charge

func (c Crossbow) Charge(releaser Releaser, _ *world.Tx, ctx *UseContext, duration time.Duration) bool

func (Crossbow) ContinueCharge

func (c Crossbow) ContinueCharge(releaser Releaser, tx *world.Tx, ctx *UseContext, duration time.Duration)

func (Crossbow) DecodeNBT

func (c Crossbow) DecodeNBT(data map[string]any) any

func (Crossbow) DurabilityInfo

func (Crossbow) DurabilityInfo() DurabilityInfo

func (Crossbow) EnchantmentValue

func (Crossbow) EnchantmentValue() int

func (Crossbow) EncodeItem

func (Crossbow) EncodeItem() (name string, meta int16)

func (Crossbow) EncodeNBT

func (c Crossbow) EncodeNBT() map[string]any

func (Crossbow) FuelInfo

func (Crossbow) FuelInfo() FuelInfo

func (Crossbow) MaxCount

func (Crossbow) MaxCount() int

func (Crossbow) ReleaseCharge

func (c Crossbow) ReleaseCharge(releaser Releaser, tx *world.Tx, ctx *UseContext) bool

type Diamond

type Diamond struct{}

func (Diamond) EncodeItem

func (Diamond) EncodeItem() (name string, meta int16)

func (Diamond) MaterialColour

func (Diamond) MaterialColour() string

func (Diamond) PayableForBeacon

func (Diamond) PayableForBeacon() bool

func (Diamond) TrimMaterial

func (Diamond) TrimMaterial() string

type DiscFragment

type DiscFragment struct{}

func (DiscFragment) EncodeItem

func (DiscFragment) EncodeItem() (name string, meta int16)

type DragonBreath

type DragonBreath struct{}

func (DragonBreath) EncodeItem

func (DragonBreath) EncodeItem() (name string, meta int16)

type DriedKelp

type DriedKelp struct{}

func (DriedKelp) AlwaysConsumable

func (DriedKelp) AlwaysConsumable() bool

func (DriedKelp) CompostChance

func (DriedKelp) CompostChance() float64

func (DriedKelp) Consume

func (DriedKelp) Consume(_ *world.Tx, c Consumer) Stack

func (DriedKelp) ConsumeDuration

func (DriedKelp) ConsumeDuration() time.Duration

func (DriedKelp) EncodeItem

func (DriedKelp) EncodeItem() (name string, meta int16)

type Drinkable

type Drinkable interface {
	Drinkable() bool
}

type DurabilityInfo

type DurabilityInfo struct {
	MaxDurability int

	BrokenItem func() Stack

	AttackDurability, BreakDurability int

	Persistent bool
}

type Durable

type Durable interface {
	DurabilityInfo() DurabilityInfo
}

type Dye

type Dye struct {
	Colour Colour
}

func (Dye) EncodeItem

func (d Dye) EncodeItem() (name string, meta int16)

func (Dye) UseOnBlock

func (d Dye) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type EchoShard

type EchoShard struct{}

func (EchoShard) EncodeItem

func (EchoShard) EncodeItem() (name string, meta int16)

type Egg

type Egg struct{}

func (Egg) EncodeItem

func (e Egg) EncodeItem() (name string, meta int16)

func (Egg) MaxCount

func (e Egg) MaxCount() int

func (Egg) Use

func (e Egg) Use(tx *world.Tx, user User, ctx *UseContext) bool

type Elytra

type Elytra struct{}

func (Elytra) Chestplate

func (Elytra) Chestplate() bool

func (Elytra) DefencePoints

func (Elytra) DefencePoints() float64

func (Elytra) DurabilityInfo

func (Elytra) DurabilityInfo() DurabilityInfo

func (Elytra) EncodeItem

func (Elytra) EncodeItem() (name string, meta int16)

func (Elytra) KnockBackResistance

func (e Elytra) KnockBackResistance() float64

func (Elytra) MaxCount

func (Elytra) MaxCount() int

func (Elytra) RepairableBy

func (Elytra) RepairableBy(i Stack) bool

func (Elytra) Toughness

func (e Elytra) Toughness() float64

func (Elytra) Use

func (Elytra) Use(_ *world.Tx, _ User, ctx *UseContext) bool

type Emerald

type Emerald struct{}

func (Emerald) EncodeItem

func (Emerald) EncodeItem() (name string, meta int16)

func (Emerald) MaterialColour

func (Emerald) MaterialColour() string

func (Emerald) PayableForBeacon

func (Emerald) PayableForBeacon() bool

func (Emerald) TrimMaterial

func (Emerald) TrimMaterial() string

type Enchantable

type Enchantable interface {
	EnchantmentValue() int
}

type EnchantedApple

type EnchantedApple struct{}

func (EnchantedApple) AlwaysConsumable

func (EnchantedApple) AlwaysConsumable() bool

func (EnchantedApple) Consume

func (EnchantedApple) Consume(_ *world.Tx, c Consumer) Stack

func (EnchantedApple) ConsumeDuration

func (EnchantedApple) ConsumeDuration() time.Duration

func (EnchantedApple) EncodeItem

func (EnchantedApple) EncodeItem() (name string, meta int16)

type EnchantedBook

type EnchantedBook struct{}

func (EnchantedBook) EncodeItem

func (EnchantedBook) EncodeItem() (name string, meta int16)

func (EnchantedBook) MaxCount

func (b EnchantedBook) MaxCount() int

type Enchantment

type Enchantment struct {
	// contains filtered or unexported fields
}

func NewEnchantment

func NewEnchantment(t EnchantmentType, lvl int) Enchantment

func (Enchantment) Level

func (e Enchantment) Level() int

func (Enchantment) Type

func (e Enchantment) Type() EnchantmentType

type EnchantmentRarity

type EnchantmentRarity interface {
	Name() string

	Cost() int

	Weight() int
}

type EnchantmentType

type EnchantmentType interface {
	Name() string

	MaxLevel() int

	Cost(level int) (int, int)

	Rarity() EnchantmentRarity

	CompatibleWithEnchantment(t EnchantmentType) bool

	CompatibleWithItem(i world.Item) bool
}

func EnchantmentByID

func EnchantmentByID(id int) (EnchantmentType, bool)

func Enchantments

func Enchantments() []EnchantmentType

type EnderEye

type EnderEye struct{}

func (EnderEye) EncodeItem

func (EnderEye) EncodeItem() (name string, meta int16)

func (EnderEye) MaxCount

func (EnderEye) MaxCount() int

func (EnderEye) UseOnBlock

func (EnderEye) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type EnderPearl

type EnderPearl struct{}

func (EnderPearl) Cooldown

func (EnderPearl) Cooldown() time.Duration

func (EnderPearl) EncodeItem

func (EnderPearl) EncodeItem() (name string, meta int16)

func (EnderPearl) MaxCount

func (EnderPearl) MaxCount() int

func (EnderPearl) Use

func (e EnderPearl) Use(tx *world.Tx, user User, ctx *UseContext) bool

type Feather

type Feather struct{}

func (Feather) EncodeItem

func (Feather) EncodeItem() (name string, meta int16)

type FermentedSpiderEye

type FermentedSpiderEye struct{}

func (FermentedSpiderEye) EncodeItem

func (FermentedSpiderEye) EncodeItem() (name string, meta int16)

type FireCharge

type FireCharge struct{}

func (FireCharge) EncodeItem

func (f FireCharge) EncodeItem() (name string, meta int16)

func (FireCharge) UseOnBlock

func (f FireCharge) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type Firework

type Firework struct {
	Duration time.Duration

	Explosions []FireworkExplosion
}

func (Firework) DecodeNBT

func (f Firework) DecodeNBT(data map[string]any) any

func (Firework) EncodeItem

func (Firework) EncodeItem() (name string, meta int16)

func (Firework) EncodeNBT

func (f Firework) EncodeNBT() map[string]any

func (Firework) OffHand

func (Firework) OffHand() bool

func (Firework) RandomisedDuration

func (f Firework) RandomisedDuration() time.Duration

func (Firework) Use

func (f Firework) Use(tx *world.Tx, user User, ctx *UseContext) bool

func (Firework) UseOnBlock

func (f Firework) UseOnBlock(pos cube.Pos, _ cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type FireworkExplosion

type FireworkExplosion struct {
	Shape FireworkShape

	Colour Colour

	Fade Colour

	Fades bool

	Twinkle bool

	Trail bool
}

func (FireworkExplosion) DecodeNBT

func (f FireworkExplosion) DecodeNBT(data map[string]any) any

func (FireworkExplosion) EncodeNBT

func (f FireworkExplosion) EncodeNBT() map[string]any

type FireworkShape

type FireworkShape struct {
	// contains filtered or unexported fields
}

func FireworkShapeBurst

func FireworkShapeBurst() FireworkShape

func FireworkShapeCreeperHead

func FireworkShapeCreeperHead() FireworkShape

func FireworkShapeHugeSphere

func FireworkShapeHugeSphere() FireworkShape

func FireworkShapeSmallSphere

func FireworkShapeSmallSphere() FireworkShape

func FireworkShapeStar

func FireworkShapeStar() FireworkShape

func FireworkShapes

func FireworkShapes() []FireworkShape

func (FireworkShape) Name

func (f FireworkShape) Name() string

func (FireworkShape) String

func (f FireworkShape) String() string

func (FireworkShape) Uint8

func (f FireworkShape) Uint8() uint8

type FireworkStar

type FireworkStar struct {
	FireworkExplosion
}

func (FireworkStar) DecodeNBT

func (f FireworkStar) DecodeNBT(data map[string]any) any

func (FireworkStar) EncodeItem

func (f FireworkStar) EncodeItem() (name string, meta int16)

func (FireworkStar) EncodeNBT

func (f FireworkStar) EncodeNBT() map[string]any

type Flint

type Flint struct{}

func (Flint) EncodeItem

func (Flint) EncodeItem() (name string, meta int16)

type FlintAndSteel

type FlintAndSteel struct{}

func (FlintAndSteel) DurabilityInfo

func (f FlintAndSteel) DurabilityInfo() DurabilityInfo

func (FlintAndSteel) EncodeItem

func (f FlintAndSteel) EncodeItem() (name string, meta int16)

func (FlintAndSteel) MaxCount

func (f FlintAndSteel) MaxCount() int

func (FlintAndSteel) UseOnBlock

func (f FlintAndSteel) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type Fuel

type Fuel interface {
	FuelInfo() FuelInfo
}

type FuelInfo

type FuelInfo struct {
	Duration time.Duration

	Residue Stack
}

func (FuelInfo) WithResidue

func (f FuelInfo) WithResidue(residue Stack) FuelInfo

type GhastTear

type GhastTear struct{}

func (GhastTear) EncodeItem

func (GhastTear) EncodeItem() (name string, meta int16)

type GlassBottle

type GlassBottle struct{}

func (GlassBottle) EncodeItem

func (g GlassBottle) EncodeItem() (name string, meta int16)

func (GlassBottle) UseOnBlock

func (g GlassBottle) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type Glinted

type Glinted interface {
	Glinted() bool
}

type GlisteringMelonSlice

type GlisteringMelonSlice struct{}

func (GlisteringMelonSlice) EncodeItem

func (GlisteringMelonSlice) EncodeItem() (name string, meta int16)

type GlowstoneDust

type GlowstoneDust struct{}

func (GlowstoneDust) EncodeItem

func (g GlowstoneDust) EncodeItem() (name string, meta int16)

type GoatHorn

type GoatHorn struct {
	Type sound.Horn
	// contains filtered or unexported fields
}

func (GoatHorn) Cooldown

func (GoatHorn) Cooldown() time.Duration

func (GoatHorn) EncodeItem

func (g GoatHorn) EncodeItem() (name string, meta int16)

func (GoatHorn) MaxCount

func (GoatHorn) MaxCount() int

func (GoatHorn) Release

func (GoatHorn) Release(Releaser, *world.Tx, *UseContext, time.Duration)

func (GoatHorn) Requirements

func (GoatHorn) Requirements() []Stack

func (GoatHorn) Use

func (g GoatHorn) Use(tx *world.Tx, user User, _ *UseContext) bool

type GoldIngot

type GoldIngot struct{}

func (GoldIngot) EncodeItem

func (GoldIngot) EncodeItem() (name string, meta int16)

func (GoldIngot) MaterialColour

func (GoldIngot) MaterialColour() string

func (GoldIngot) PayableForBeacon

func (GoldIngot) PayableForBeacon() bool

func (GoldIngot) TrimMaterial

func (GoldIngot) TrimMaterial() string

type GoldNugget

type GoldNugget struct{}

func (GoldNugget) EncodeItem

func (GoldNugget) EncodeItem() (name string, meta int16)

type GoldenApple

type GoldenApple struct{}

func (GoldenApple) AlwaysConsumable

func (e GoldenApple) AlwaysConsumable() bool

func (GoldenApple) Consume

func (e GoldenApple) Consume(_ *world.Tx, c Consumer) Stack

func (GoldenApple) ConsumeDuration

func (e GoldenApple) ConsumeDuration() time.Duration

func (GoldenApple) EncodeItem

func (e GoldenApple) EncodeItem() (name string, meta int16)

type GoldenCarrot

type GoldenCarrot struct {
	// contains filtered or unexported fields
}

func (GoldenCarrot) AlwaysConsumable

func (GoldenCarrot) AlwaysConsumable() bool

func (GoldenCarrot) Consume

func (GoldenCarrot) Consume(_ *world.Tx, c Consumer) Stack

func (GoldenCarrot) ConsumeDuration

func (d GoldenCarrot) ConsumeDuration() time.Duration

func (GoldenCarrot) EncodeItem

func (GoldenCarrot) EncodeItem() (name string, meta int16)

type Gunpowder

type Gunpowder struct{}

func (Gunpowder) EncodeItem

func (Gunpowder) EncodeItem() (name string, meta int16)

type HandEquipped

type HandEquipped interface {
	HandEquipped() bool
}

type HeartOfTheSea

type HeartOfTheSea struct{}

func (HeartOfTheSea) EncodeItem

func (HeartOfTheSea) EncodeItem() (name string, meta int16)

type Helmet

type Helmet struct {
	Tier ArmourTier

	Trim ArmourTrim
}

func (Helmet) DecodeNBT

func (h Helmet) DecodeNBT(data map[string]any) any

func (Helmet) DefencePoints

func (h Helmet) DefencePoints() float64

func (Helmet) DurabilityInfo

func (h Helmet) DurabilityInfo() DurabilityInfo

func (Helmet) EnchantmentValue

func (h Helmet) EnchantmentValue() int

func (Helmet) EncodeItem

func (h Helmet) EncodeItem() (name string, meta int16)

func (Helmet) EncodeNBT

func (h Helmet) EncodeNBT() map[string]any

func (Helmet) Helmet

func (h Helmet) Helmet() bool

func (Helmet) KnockBackResistance

func (h Helmet) KnockBackResistance() float64

func (Helmet) MaxCount

func (h Helmet) MaxCount() int

func (Helmet) RepairableBy

func (h Helmet) RepairableBy(i Stack) bool

func (Helmet) SmeltInfo

func (h Helmet) SmeltInfo() SmeltInfo

func (Helmet) Toughness

func (h Helmet) Toughness() float64

func (Helmet) Use

func (h Helmet) Use(_ *world.Tx, _ User, ctx *UseContext) bool

func (Helmet) WithTrim

func (h Helmet) WithTrim(trim ArmourTrim) world.Item

type HelmetType

type HelmetType interface {
	Armour
	Helmet() bool
}

type Hoe

type Hoe struct {
	Tier ToolTier
}

func (Hoe) AttackDamage

func (h Hoe) AttackDamage() float64

func (Hoe) BaseMiningEfficiency

func (h Hoe) BaseMiningEfficiency(world.Block) float64

func (Hoe) DurabilityInfo

func (h Hoe) DurabilityInfo() DurabilityInfo

func (Hoe) EnchantmentValue

func (h Hoe) EnchantmentValue() int

func (Hoe) EncodeItem

func (h Hoe) EncodeItem() (name string, meta int16)

func (Hoe) FuelInfo

func (h Hoe) FuelInfo() FuelInfo

func (Hoe) HarvestLevel

func (h Hoe) HarvestLevel() int

func (Hoe) MaxCount

func (h Hoe) MaxCount() int

func (Hoe) RepairableBy

func (h Hoe) RepairableBy(i Stack) bool

func (Hoe) SmeltInfo

func (h Hoe) SmeltInfo() SmeltInfo

func (Hoe) ToolType

func (h Hoe) ToolType() ToolType

func (Hoe) UseOnBlock

func (h Hoe) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type HoneyBottle

type HoneyBottle struct{}

func (HoneyBottle) AlwaysConsumable

func (HoneyBottle) AlwaysConsumable() bool

func (HoneyBottle) Consume

func (HoneyBottle) Consume(_ *world.Tx, c Consumer) Stack

func (HoneyBottle) ConsumeDuration

func (HoneyBottle) ConsumeDuration() time.Duration

func (HoneyBottle) EncodeItem

func (HoneyBottle) EncodeItem() (name string, meta int16)

func (HoneyBottle) MaxCount

func (HoneyBottle) MaxCount() int

type Honeycomb

type Honeycomb struct{}

func (Honeycomb) EncodeItem

func (Honeycomb) EncodeItem() (name string, meta int16)

func (Honeycomb) UseOnBlock

func (Honeycomb) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type InkSac

type InkSac struct {
	Glowing bool
}

func (InkSac) EncodeItem

func (i InkSac) EncodeItem() (name string, meta int16)

func (InkSac) UseOnBlock

func (i InkSac) UseOnBlock(pos cube.Pos, _ cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type IronIngot

type IronIngot struct{}

func (IronIngot) EncodeItem

func (IronIngot) EncodeItem() (name string, meta int16)

func (IronIngot) MaterialColour

func (IronIngot) MaterialColour() string

func (IronIngot) PayableForBeacon

func (IronIngot) PayableForBeacon() bool

func (IronIngot) TrimMaterial

func (IronIngot) TrimMaterial() string

type IronNugget

type IronNugget struct{}

func (IronNugget) EncodeItem

func (IronNugget) EncodeItem() (name string, meta int16)

type LapisLazuli

type LapisLazuli struct{}

func (LapisLazuli) EncodeItem

func (LapisLazuli) EncodeItem() (name string, meta int16)

func (LapisLazuli) MaterialColour

func (LapisLazuli) MaterialColour() string

func (LapisLazuli) TrimMaterial

func (LapisLazuli) TrimMaterial() string

type Leather

type Leather struct{}

func (Leather) EncodeItem

func (Leather) EncodeItem() (name string, meta int16)

type Leggings

type Leggings struct {
	Tier ArmourTier

	Trim ArmourTrim
}

func (Leggings) DecodeNBT

func (l Leggings) DecodeNBT(data map[string]any) any

func (Leggings) DefencePoints

func (l Leggings) DefencePoints() float64

func (Leggings) DurabilityInfo

func (l Leggings) DurabilityInfo() DurabilityInfo

func (Leggings) EnchantmentValue

func (l Leggings) EnchantmentValue() int

func (Leggings) EncodeItem

func (l Leggings) EncodeItem() (name string, meta int16)

func (Leggings) EncodeNBT

func (l Leggings) EncodeNBT() map[string]any

func (Leggings) KnockBackResistance

func (l Leggings) KnockBackResistance() float64

func (Leggings) Leggings

func (l Leggings) Leggings() bool

func (Leggings) MaxCount

func (l Leggings) MaxCount() int

func (Leggings) RepairableBy

func (l Leggings) RepairableBy(i Stack) bool

func (Leggings) SmeltInfo

func (l Leggings) SmeltInfo() SmeltInfo

func (Leggings) Toughness

func (l Leggings) Toughness() float64

func (Leggings) Use

func (l Leggings) Use(_ *world.Tx, _ User, ctx *UseContext) bool

func (Leggings) WithTrim

func (l Leggings) WithTrim(trim ArmourTrim) world.Item

type LeggingsType

type LeggingsType interface {
	Armour
	Leggings() bool
}

type LingeringPotion

type LingeringPotion struct {
	Type potion.Potion
}

func (LingeringPotion) EncodeItem

func (l LingeringPotion) EncodeItem() (name string, meta int16)

func (LingeringPotion) MaxCount

func (l LingeringPotion) MaxCount() int

func (LingeringPotion) Use

func (l LingeringPotion) Use(tx *world.Tx, user User, ctx *UseContext) bool

type MagmaCream

type MagmaCream struct{}

func (MagmaCream) EncodeItem

func (m MagmaCream) EncodeItem() (name string, meta int16)

type MaxCounter

type MaxCounter interface {
	MaxCount() int
}

type MelonSlice

type MelonSlice struct{}

func (MelonSlice) AlwaysConsumable

func (m MelonSlice) AlwaysConsumable() bool

func (MelonSlice) CompostChance

func (MelonSlice) CompostChance() float64

func (MelonSlice) Consume

func (m MelonSlice) Consume(_ *world.Tx, c Consumer) Stack

func (MelonSlice) ConsumeDuration

func (m MelonSlice) ConsumeDuration() time.Duration

func (MelonSlice) EncodeItem

func (m MelonSlice) EncodeItem() (name string, meta int16)

type MushroomStew

type MushroomStew struct {
	// contains filtered or unexported fields
}

func (MushroomStew) AlwaysConsumable

func (MushroomStew) AlwaysConsumable() bool

func (MushroomStew) Consume

func (MushroomStew) Consume(_ *world.Tx, c Consumer) Stack

func (MushroomStew) ConsumeDuration

func (d MushroomStew) ConsumeDuration() time.Duration

func (MushroomStew) EncodeItem

func (MushroomStew) EncodeItem() (name string, meta int16)

func (MushroomStew) MaxCount

func (MushroomStew) MaxCount() int

type MusicDisc

type MusicDisc struct {
	DiscType sound.DiscType
}

func (MusicDisc) EncodeItem

func (m MusicDisc) EncodeItem() (name string, meta int16)

func (MusicDisc) MaxCount

func (MusicDisc) MaxCount() int

type Mutton

type Mutton struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Mutton) AlwaysConsumable

func (Mutton) AlwaysConsumable() bool

func (Mutton) Consume

func (m Mutton) Consume(_ *world.Tx, c Consumer) Stack

func (Mutton) ConsumeDuration

func (d Mutton) ConsumeDuration() time.Duration

func (Mutton) EncodeItem

func (m Mutton) EncodeItem() (name string, meta int16)

func (Mutton) SmeltInfo

func (m Mutton) SmeltInfo() SmeltInfo

type NautilusShell

type NautilusShell struct{}

func (NautilusShell) EncodeItem

func (NautilusShell) EncodeItem() (name string, meta int16)

func (NautilusShell) OffHand

func (NautilusShell) OffHand() bool

type NetherBrick

type NetherBrick struct{}

func (NetherBrick) EncodeItem

func (NetherBrick) EncodeItem() (name string, meta int16)

type NetherQuartz

type NetherQuartz struct{}

func (NetherQuartz) EncodeItem

func (NetherQuartz) EncodeItem() (name string, meta int16)

func (NetherQuartz) MaterialColour

func (NetherQuartz) MaterialColour() string

func (NetherQuartz) TrimMaterial

func (NetherQuartz) TrimMaterial() string

type NetherStar

type NetherStar struct{}

func (NetherStar) BlastProof

func (NetherStar) BlastProof() bool

func (NetherStar) EncodeItem

func (NetherStar) EncodeItem() (name string, meta int16)

type NetheriteIngot

type NetheriteIngot struct{}

func (NetheriteIngot) EncodeItem

func (NetheriteIngot) EncodeItem() (name string, meta int16)

func (NetheriteIngot) MaterialColour

func (NetheriteIngot) MaterialColour() string

func (NetheriteIngot) PayableForBeacon

func (NetheriteIngot) PayableForBeacon() bool

func (NetheriteIngot) TrimMaterial

func (NetheriteIngot) TrimMaterial() string

type NetheriteScrap

type NetheriteScrap struct{}

func (NetheriteScrap) EncodeItem

func (NetheriteScrap) EncodeItem() (name string, meta int16)

type OffHand

type OffHand interface {
	OffHand() bool
}

type OptionalColour

type OptionalColour uint8

func NewOptionalColour

func NewOptionalColour(c Colour) OptionalColour

func OptionalColours

func OptionalColours() []OptionalColour

func (OptionalColour) Colour

func (oc OptionalColour) Colour() (Colour, bool)

func (OptionalColour) Prepend

func (oc OptionalColour) Prepend(str string) string

func (OptionalColour) Uint8

func (oc OptionalColour) Uint8() uint8

type Paper

type Paper struct{}

func (Paper) EncodeItem

func (Paper) EncodeItem() (name string, meta int16)

type PhantomMembrane

type PhantomMembrane struct{}

func (PhantomMembrane) EncodeItem

func (PhantomMembrane) EncodeItem() (name string, meta int16)

type Pickaxe

type Pickaxe struct {
	Tier ToolTier
}

func (Pickaxe) AttackDamage

func (p Pickaxe) AttackDamage() float64

func (Pickaxe) BaseMiningEfficiency

func (p Pickaxe) BaseMiningEfficiency(world.Block) float64

func (Pickaxe) DurabilityInfo

func (p Pickaxe) DurabilityInfo() DurabilityInfo

func (Pickaxe) EnchantmentValue

func (p Pickaxe) EnchantmentValue() int

func (Pickaxe) EncodeItem

func (p Pickaxe) EncodeItem() (name string, meta int16)

func (Pickaxe) FuelInfo

func (p Pickaxe) FuelInfo() FuelInfo

func (Pickaxe) HarvestLevel

func (p Pickaxe) HarvestLevel() int

func (Pickaxe) MaxCount

func (p Pickaxe) MaxCount() int

func (Pickaxe) RepairableBy

func (p Pickaxe) RepairableBy(i Stack) bool

func (Pickaxe) SmeltInfo

func (p Pickaxe) SmeltInfo() SmeltInfo

func (Pickaxe) ToolType

func (p Pickaxe) ToolType() ToolType

type PoisonousPotato

type PoisonousPotato struct {
	// contains filtered or unexported fields
}

func (PoisonousPotato) AlwaysConsumable

func (PoisonousPotato) AlwaysConsumable() bool

func (PoisonousPotato) Consume

func (p PoisonousPotato) Consume(_ *world.Tx, c Consumer) Stack

func (PoisonousPotato) ConsumeDuration

func (d PoisonousPotato) ConsumeDuration() time.Duration

func (PoisonousPotato) EncodeItem

func (p PoisonousPotato) EncodeItem() (name string, meta int16)

type PoppedChorusFruit

type PoppedChorusFruit struct{}

func (PoppedChorusFruit) EncodeItem

func (PoppedChorusFruit) EncodeItem() (name string, meta int16)

type Porkchop

type Porkchop struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Porkchop) AlwaysConsumable

func (Porkchop) AlwaysConsumable() bool

func (Porkchop) Consume

func (p Porkchop) Consume(_ *world.Tx, c Consumer) Stack

func (Porkchop) ConsumeDuration

func (d Porkchop) ConsumeDuration() time.Duration

func (Porkchop) EncodeItem

func (p Porkchop) EncodeItem() (name string, meta int16)

func (Porkchop) SmeltInfo

func (p Porkchop) SmeltInfo() SmeltInfo

type Potion

type Potion struct {
	Type potion.Potion
}

func (Potion) AlwaysConsumable

func (p Potion) AlwaysConsumable() bool

func (Potion) Consume

func (p Potion) Consume(_ *world.Tx, c Consumer) Stack

func (Potion) ConsumeDuration

func (p Potion) ConsumeDuration() time.Duration

func (Potion) EncodeItem

func (p Potion) EncodeItem() (name string, meta int16)

func (Potion) MaxCount

func (p Potion) MaxCount() int

type PotterySherd

type PotterySherd struct {
	Type SherdType
}

func (PotterySherd) EncodeItem

func (s PotterySherd) EncodeItem() (name string, meta int16)

func (PotterySherd) PotDecoration

func (PotterySherd) PotDecoration() bool

type PrismarineCrystals

type PrismarineCrystals struct{}

func (PrismarineCrystals) EncodeItem

func (p PrismarineCrystals) EncodeItem() (name string, meta int16)

type PrismarineShard

type PrismarineShard struct{}

func (PrismarineShard) EncodeItem

func (PrismarineShard) EncodeItem() (name string, meta int16)

type Pufferfish

type Pufferfish struct {
	// contains filtered or unexported fields
}

func (Pufferfish) AlwaysConsumable

func (Pufferfish) AlwaysConsumable() bool

func (Pufferfish) Consume

func (p Pufferfish) Consume(_ *world.Tx, c Consumer) Stack

func (Pufferfish) ConsumeDuration

func (d Pufferfish) ConsumeDuration() time.Duration

func (Pufferfish) EncodeItem

func (p Pufferfish) EncodeItem() (name string, meta int16)

type PumpkinPie

type PumpkinPie struct {
	// contains filtered or unexported fields
}

func (PumpkinPie) AlwaysConsumable

func (PumpkinPie) AlwaysConsumable() bool

func (PumpkinPie) CompostChance

func (PumpkinPie) CompostChance() float64

func (PumpkinPie) Consume

func (PumpkinPie) Consume(_ *world.Tx, c Consumer) Stack

func (PumpkinPie) ConsumeDuration

func (d PumpkinPie) ConsumeDuration() time.Duration

func (PumpkinPie) EncodeItem

func (PumpkinPie) EncodeItem() (name string, meta int16)

type Rabbit

type Rabbit struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Rabbit) AlwaysConsumable

func (Rabbit) AlwaysConsumable() bool

func (Rabbit) Consume

func (r Rabbit) Consume(_ *world.Tx, c Consumer) Stack

func (Rabbit) ConsumeDuration

func (d Rabbit) ConsumeDuration() time.Duration

func (Rabbit) EncodeItem

func (r Rabbit) EncodeItem() (name string, meta int16)

func (Rabbit) SmeltInfo

func (r Rabbit) SmeltInfo() SmeltInfo

type RabbitFoot

type RabbitFoot struct{}

func (RabbitFoot) EncodeItem

func (RabbitFoot) EncodeItem() (name string, meta int16)

type RabbitHide

type RabbitHide struct{}

func (RabbitHide) EncodeItem

func (RabbitHide) EncodeItem() (name string, meta int16)

type RabbitStew

type RabbitStew struct {
	// contains filtered or unexported fields
}

func (RabbitStew) AlwaysConsumable

func (RabbitStew) AlwaysConsumable() bool

func (RabbitStew) Consume

func (RabbitStew) Consume(_ *world.Tx, c Consumer) Stack

func (RabbitStew) ConsumeDuration

func (d RabbitStew) ConsumeDuration() time.Duration

func (RabbitStew) EncodeItem

func (RabbitStew) EncodeItem() (name string, meta int16)

func (RabbitStew) MaxCount

func (RabbitStew) MaxCount() int

type RawCopper

type RawCopper struct{}

func (RawCopper) EncodeItem

func (RawCopper) EncodeItem() (name string, meta int16)

func (RawCopper) SmeltInfo

func (RawCopper) SmeltInfo() SmeltInfo

type RawGold

type RawGold struct{}

func (RawGold) EncodeItem

func (RawGold) EncodeItem() (name string, meta int16)

func (RawGold) SmeltInfo

func (RawGold) SmeltInfo() SmeltInfo

type RawIron

type RawIron struct{}

func (RawIron) EncodeItem

func (RawIron) EncodeItem() (name string, meta int16)

func (RawIron) SmeltInfo

func (RawIron) SmeltInfo() SmeltInfo

type RecoveryCompass

type RecoveryCompass struct{}

func (RecoveryCompass) EncodeItem

func (RecoveryCompass) EncodeItem() (name string, meta int16)

type RedstoneWire

type RedstoneWire struct{}

func (RedstoneWire) EncodeItem

func (RedstoneWire) EncodeItem() (name string, meta int16)

func (RedstoneWire) MaterialColour

func (RedstoneWire) MaterialColour() string

func (RedstoneWire) TrimMaterial

func (RedstoneWire) TrimMaterial() string

type Releasable

type Releasable interface {
	Release(releaser Releaser, tx *world.Tx, ctx *UseContext, duration time.Duration)

	Requirements() []Stack
}

type Releaser

type Releaser interface {
	User

	GameMode() world.GameMode

	PlaySound(sound world.Sound)
}

type Repairable

type Repairable interface {
	Durable
	RepairableBy(i Stack) bool
}

type ResinBrick

type ResinBrick struct{}

func (ResinBrick) EncodeItem

func (ResinBrick) EncodeItem() (name string, meta int16)

func (ResinBrick) MaterialColour

func (ResinBrick) MaterialColour() string

func (ResinBrick) TrimMaterial

func (ResinBrick) TrimMaterial() string

type RottenFlesh

type RottenFlesh struct {
	// contains filtered or unexported fields
}

func (RottenFlesh) AlwaysConsumable

func (RottenFlesh) AlwaysConsumable() bool

func (RottenFlesh) Consume

func (RottenFlesh) Consume(_ *world.Tx, c Consumer) Stack

func (RottenFlesh) ConsumeDuration

func (d RottenFlesh) ConsumeDuration() time.Duration

func (RottenFlesh) EncodeItem

func (RottenFlesh) EncodeItem() (name string, meta int16)

type Salmon

type Salmon struct {
	Cooked bool
	// contains filtered or unexported fields
}

func (Salmon) AlwaysConsumable

func (Salmon) AlwaysConsumable() bool

func (Salmon) Consume

func (s Salmon) Consume(_ *world.Tx, c Consumer) Stack

func (Salmon) ConsumeDuration

func (d Salmon) ConsumeDuration() time.Duration

func (Salmon) EncodeItem

func (s Salmon) EncodeItem() (name string, meta int16)

func (Salmon) SmeltInfo

func (s Salmon) SmeltInfo() SmeltInfo

type Scute

type Scute struct{}

func (Scute) EncodeItem

func (Scute) EncodeItem() (name string, meta int16)

type Shears

type Shears struct{}

func (Shears) BaseMiningEfficiency

func (s Shears) BaseMiningEfficiency(world.Block) float64

func (Shears) DurabilityInfo

func (s Shears) DurabilityInfo() DurabilityInfo

func (Shears) EncodeItem

func (s Shears) EncodeItem() (name string, meta int16)

func (Shears) HarvestLevel

func (s Shears) HarvestLevel() int

func (Shears) MaxCount

func (s Shears) MaxCount() int

func (Shears) ToolType

func (s Shears) ToolType() ToolType

func (Shears) UseOnBlock

func (s Shears) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type SherdType

type SherdType struct {
	// contains filtered or unexported fields
}

func SherdTypeAngler

func SherdTypeAngler() SherdType

func SherdTypeArcher

func SherdTypeArcher() SherdType

func SherdTypeArmsUp

func SherdTypeArmsUp() SherdType

func SherdTypeBlade

func SherdTypeBlade() SherdType

func SherdTypeBrewer

func SherdTypeBrewer() SherdType

func SherdTypeBurn

func SherdTypeBurn() SherdType

func SherdTypeDanger

func SherdTypeDanger() SherdType

func SherdTypeExplorer

func SherdTypeExplorer() SherdType

func SherdTypeFlow

func SherdTypeFlow() SherdType

func SherdTypeFriend

func SherdTypeFriend() SherdType

func SherdTypeGuster

func SherdTypeGuster() SherdType

func SherdTypeHeart

func SherdTypeHeart() SherdType

func SherdTypeHeartbreak

func SherdTypeHeartbreak() SherdType

func SherdTypeHowl

func SherdTypeHowl() SherdType

func SherdTypeMiner

func SherdTypeMiner() SherdType

func SherdTypeMourner

func SherdTypeMourner() SherdType

func SherdTypePlenty

func SherdTypePlenty() SherdType

func SherdTypePrize

func SherdTypePrize() SherdType

func SherdTypeScrape

func SherdTypeScrape() SherdType

func SherdTypeSheaf

func SherdTypeSheaf() SherdType

func SherdTypeShelter

func SherdTypeShelter() SherdType

func SherdTypeSkull

func SherdTypeSkull() SherdType

func SherdTypeSnort

func SherdTypeSnort() SherdType

func SherdTypes

func SherdTypes() []SherdType

func (SherdType) String

func (c SherdType) String() string

func (SherdType) Uint8

func (c SherdType) Uint8() uint8

type Shovel

type Shovel struct {
	Tier ToolTier
}

func (Shovel) AttackDamage

func (s Shovel) AttackDamage() float64

func (Shovel) BaseMiningEfficiency

func (s Shovel) BaseMiningEfficiency(world.Block) float64

func (Shovel) DurabilityInfo

func (s Shovel) DurabilityInfo() DurabilityInfo

func (Shovel) EnchantmentValue

func (s Shovel) EnchantmentValue() int

func (Shovel) EncodeItem

func (s Shovel) EncodeItem() (name string, meta int16)

func (Shovel) FuelInfo

func (s Shovel) FuelInfo() FuelInfo

func (Shovel) HarvestLevel

func (s Shovel) HarvestLevel() int

func (Shovel) MaxCount

func (s Shovel) MaxCount() int

func (Shovel) RepairableBy

func (s Shovel) RepairableBy(i Stack) bool

func (Shovel) SmeltInfo

func (s Shovel) SmeltInfo() SmeltInfo

func (Shovel) ToolType

func (s Shovel) ToolType() ToolType

func (Shovel) UseOnBlock

func (s Shovel) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, _ User, ctx *UseContext) bool

type ShulkerShell

type ShulkerShell struct{}

func (ShulkerShell) EncodeItem

func (ShulkerShell) EncodeItem() (name string, meta int16)

type Slimeball

type Slimeball struct{}

func (Slimeball) EncodeItem

func (Slimeball) EncodeItem() (name string, meta int16)

type SmeltInfo

type SmeltInfo struct {
	Product Stack

	Experience float64

	Food bool

	Ores bool
}

type Smeltable

type Smeltable interface {
	SmeltInfo() SmeltInfo
}

type SmithingTemplate

type SmithingTemplate struct {
	Template SmithingTemplateType
}

func (SmithingTemplate) EncodeItem

func (t SmithingTemplate) EncodeItem() (name string, meta int16)

type SmithingTemplateType

type SmithingTemplateType struct {
	// contains filtered or unexported fields
}

func SmithingTemplates

func SmithingTemplates() []SmithingTemplateType

func TemplateBolt

func TemplateBolt() SmithingTemplateType

func TemplateCoast

func TemplateCoast() SmithingTemplateType

func TemplateDune

func TemplateDune() SmithingTemplateType

func TemplateEye

func TemplateEye() SmithingTemplateType

func TemplateFlow

func TemplateFlow() SmithingTemplateType

func TemplateHost

func TemplateHost() SmithingTemplateType

func TemplateNetheriteUpgrade

func TemplateNetheriteUpgrade() SmithingTemplateType

func TemplateRaiser

func TemplateRaiser() SmithingTemplateType

func TemplateRib

func TemplateRib() SmithingTemplateType

func TemplateSentry

func TemplateSentry() SmithingTemplateType

func TemplateShaper

func TemplateShaper() SmithingTemplateType

func TemplateSilence

func TemplateSilence() SmithingTemplateType

func TemplateSnout

func TemplateSnout() SmithingTemplateType

func TemplateSpire

func TemplateSpire() SmithingTemplateType

func TemplateTide

func TemplateTide() SmithingTemplateType

func TemplateVex

func TemplateVex() SmithingTemplateType

func TemplateWard

func TemplateWard() SmithingTemplateType

func TemplateWayFinder

func TemplateWayFinder() SmithingTemplateType

func TemplateWild

func TemplateWild() SmithingTemplateType

func (SmithingTemplateType) String

func (s SmithingTemplateType) String() string

type Snowball

type Snowball struct{}

func (Snowball) EncodeItem

func (s Snowball) EncodeItem() (name string, meta int16)

func (Snowball) MaxCount

func (s Snowball) MaxCount() int

func (Snowball) Use

func (s Snowball) Use(tx *world.Tx, user User, ctx *UseContext) bool

type SpawnEgg

type SpawnEgg struct {
	ItemName string
}

func (SpawnEgg) EncodeItem

func (e SpawnEgg) EncodeItem() (name string, meta int16)

func (SpawnEgg) UseOnBlock

func (e SpawnEgg) UseOnBlock(pos cube.Pos, face cube.Face, _ mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool

type SpiderEye

type SpiderEye struct {
	// contains filtered or unexported fields
}

func (SpiderEye) AlwaysConsumable

func (SpiderEye) AlwaysConsumable() bool

func (SpiderEye) Consume

func (SpiderEye) Consume(_ *world.Tx, c Consumer) Stack

func (SpiderEye) ConsumeDuration

func (d SpiderEye) ConsumeDuration() time.Duration

func (SpiderEye) EncodeItem

func (SpiderEye) EncodeItem() (name string, meta int16)

type SplashPotion

type SplashPotion struct {
	Type potion.Potion
}

func (SplashPotion) EncodeItem

func (s SplashPotion) EncodeItem() (name string, meta int16)

func (SplashPotion) MaxCount

func (s SplashPotion) MaxCount() int

func (SplashPotion) Use

func (s SplashPotion) Use(tx *world.Tx, user User, ctx *UseContext) bool

type Spyglass

type Spyglass struct {
	// contains filtered or unexported fields
}

func (Spyglass) EncodeItem

func (Spyglass) EncodeItem() (name string, meta int16)

func (Spyglass) MaxCount

func (Spyglass) MaxCount() int

func (Spyglass) Release

func (Spyglass) Release(Releaser, *world.Tx, *UseContext, time.Duration)

func (Spyglass) Requirements

func (Spyglass) Requirements() []Stack

type Stack

type Stack struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack(t world.Item, count int) Stack

func (Stack) AddStack

func (s Stack) AddStack(s2 Stack) (a, b Stack)

func (Stack) AnvilCost

func (s Stack) AnvilCost() int

func (Stack) AsBreakable

func (s Stack) AsBreakable() Stack

func (Stack) AsUnbreakable

func (s Stack) AsUnbreakable() Stack

func (Stack) AttackDamage

func (s Stack) AttackDamage() float64

func (Stack) Comparable

func (s Stack) Comparable(s2 Stack) bool

func (Stack) Count

func (s Stack) Count() int

func (Stack) CustomName

func (s Stack) CustomName() string

func (Stack) Damage

func (s Stack) Damage(d int) Stack

func (Stack) Durability

func (s Stack) Durability() int

func (Stack) Empty

func (s Stack) Empty() bool

func (Stack) Enchantment

func (s Stack) Enchantment(enchant EnchantmentType) (Enchantment, bool)

func (Stack) Enchantments

func (s Stack) Enchantments() []Enchantment

func (Stack) Equal

func (s Stack) Equal(s2 Stack) bool

func (Stack) Grow

func (s Stack) Grow(n int) Stack

func (Stack) Item

func (s Stack) Item() world.Item

func (Stack) Lore

func (s Stack) Lore() []string

func (Stack) MaxCount

func (s Stack) MaxCount() int

func (Stack) MaxDurability

func (s Stack) MaxDurability() int

func (Stack) String

func (s Stack) String() string

func (Stack) Unbreakable

func (s Stack) Unbreakable() bool

func (Stack) Value

func (s Stack) Value(key string) (val any, ok bool)

func (Stack) Values

func (s Stack) Values() map[string]any

func (Stack) WithAnvilCost

func (s Stack) WithAnvilCost(anvilCost int) Stack

func (Stack) WithCustomName

func (s Stack) WithCustomName(a ...any) Stack

func (Stack) WithDurability

func (s Stack) WithDurability(d int) Stack

func (Stack) WithEnchantments

func (s Stack) WithEnchantments(enchants ...Enchantment) Stack

func (Stack) WithForcedEnchantments

func (s Stack) WithForcedEnchantments(enchants ...Enchantment) Stack

func (Stack) WithItem

func (s Stack) WithItem(t world.Item) Stack

func (Stack) WithLore

func (s Stack) WithLore(lines ...string) Stack

func (Stack) WithValue

func (s Stack) WithValue(key string, val any) Stack

func (Stack) WithoutEnchantments

func (s Stack) WithoutEnchantments(enchants ...EnchantmentType) Stack

type StewType

type StewType struct {
	// contains filtered or unexported fields
}

func BlindnessBluetStew

func BlindnessBluetStew() StewType

func BlindnessEyeblossomStew

func BlindnessEyeblossomStew() StewType

func FireResistanceStew

func FireResistanceStew() StewType

func JumpBoostStew

func JumpBoostStew() StewType

func NauseaStew

func NauseaStew() StewType

func NightVisionPoppyStew

func NightVisionPoppyStew() StewType

func NightVisionTorchflowerStew

func NightVisionTorchflowerStew() StewType

func PoisonStew

func PoisonStew() StewType

func RegenerationStew

func RegenerationStew() StewType

func SaturationDandelionStew

func SaturationDandelionStew() StewType

func SaturationOrchidStew

func SaturationOrchidStew() StewType

func StewTypes

func StewTypes() []StewType

func WeaknessStew

func WeaknessStew() StewType

func WitherStew

func WitherStew() StewType

func (StewType) Effects

func (s StewType) Effects() []effect.Effect

func (StewType) Uint8

func (s StewType) Uint8() uint8

type Stick

type Stick struct{}

func (Stick) EncodeItem

func (s Stick) EncodeItem() (name string, meta int16)

func (Stick) FuelInfo

func (Stick) FuelInfo() FuelInfo

type Strippable

type Strippable interface {
	Strip() (world.Block, world.Sound, bool)
}

type Sugar

type Sugar struct{}

func (Sugar) EncodeItem

func (Sugar) EncodeItem() (name string, meta int16)

type SuspiciousStew

type SuspiciousStew struct {
	Type StewType
	// contains filtered or unexported fields
}

func (SuspiciousStew) AlwaysConsumable

func (SuspiciousStew) AlwaysConsumable() bool

func (SuspiciousStew) Consume

func (s SuspiciousStew) Consume(_ *world.Tx, c Consumer) Stack

func (SuspiciousStew) ConsumeDuration

func (d SuspiciousStew) ConsumeDuration() time.Duration

func (SuspiciousStew) EncodeItem

func (s SuspiciousStew) EncodeItem() (name string, meta int16)

func (SuspiciousStew) MaxCount

func (SuspiciousStew) MaxCount() int

type Sword

type Sword struct {
	Tier ToolTier
}

func (Sword) AttackDamage

func (s Sword) AttackDamage() float64

func (Sword) BaseMiningEfficiency

func (s Sword) BaseMiningEfficiency(b world.Block) float64

func (Sword) DurabilityInfo

func (s Sword) DurabilityInfo() DurabilityInfo

func (Sword) EnchantmentValue

func (s Sword) EnchantmentValue() int

func (Sword) EncodeItem

func (s Sword) EncodeItem() (name string, meta int16)

func (Sword) FuelInfo

func (s Sword) FuelInfo() FuelInfo

func (Sword) HarvestLevel

func (s Sword) HarvestLevel() int

func (Sword) MaxCount

func (s Sword) MaxCount() int

func (Sword) RepairableBy

func (s Sword) RepairableBy(i Stack) bool

func (Sword) SmeltInfo

func (s Sword) SmeltInfo() SmeltInfo

func (Sword) ToolType

func (s Sword) ToolType() ToolType

type Throwable

type Throwable interface {
	SwingAnimation() bool
}

type Tool

type Tool interface {
	ToolType() ToolType

	HarvestLevel() int

	BaseMiningEfficiency(b world.Block) float64
}

type ToolNone

type ToolNone struct{}

func (ToolNone) BaseMiningEfficiency

func (n ToolNone) BaseMiningEfficiency(world.Block) float64

func (ToolNone) HarvestLevel

func (n ToolNone) HarvestLevel() int

func (ToolNone) ToolType

func (n ToolNone) ToolType() ToolType

type ToolTier

type ToolTier struct {
	HarvestLevel int

	BaseMiningEfficiency float64

	BaseAttackDamage float64

	EnchantmentValue int

	Durability int

	Name string
}

func ToolTiers

func ToolTiers() []ToolTier

type ToolType

type ToolType struct {
	// contains filtered or unexported fields
}

type Totem

type Totem struct{}

func (Totem) EncodeItem

func (Totem) EncodeItem() (name string, meta int16)

func (Totem) MaxCount

func (Totem) MaxCount() int

func (Totem) OffHand

func (Totem) OffHand() bool

type Trimmable

type Trimmable interface {
	WithTrim(trim ArmourTrim) world.Item
}

type TropicalFish

type TropicalFish struct {
	// contains filtered or unexported fields
}

func (TropicalFish) AlwaysConsumable

func (TropicalFish) AlwaysConsumable() bool

func (TropicalFish) Consume

func (TropicalFish) Consume(_ *world.Tx, c Consumer) Stack

func (TropicalFish) ConsumeDuration

func (d TropicalFish) ConsumeDuration() time.Duration

func (TropicalFish) EncodeItem

func (TropicalFish) EncodeItem() (name string, meta int16)

type TurtleShell

type TurtleShell struct{}

func (TurtleShell) DefencePoints

func (TurtleShell) DefencePoints() float64

func (TurtleShell) DurabilityInfo

func (TurtleShell) DurabilityInfo() DurabilityInfo

func (TurtleShell) EnchantmentValue

func (TurtleShell) EnchantmentValue() int

func (TurtleShell) EncodeItem

func (TurtleShell) EncodeItem() (name string, meta int16)

func (TurtleShell) Helmet

func (TurtleShell) Helmet() bool

func (TurtleShell) KnockBackResistance

func (TurtleShell) KnockBackResistance() float64

func (TurtleShell) MaxCount

func (TurtleShell) MaxCount() int

func (TurtleShell) RepairableBy

func (TurtleShell) RepairableBy(i Stack) bool

func (TurtleShell) Toughness

func (TurtleShell) Toughness() float64

func (TurtleShell) Use

func (TurtleShell) Use(_ *world.Tx, _ User, ctx *UseContext) bool

type Usable

type Usable interface {
	Use(tx *world.Tx, user User, ctx *UseContext) bool
}

type UsableOnBlock

type UsableOnBlock interface {
	UseOnBlock(pos cube.Pos, face cube.Face, clickPos mgl64.Vec3, tx *world.Tx, user User, ctx *UseContext) bool
}

type UsableOnEntity

type UsableOnEntity interface {
	UseOnEntity(e world.Entity, tx *world.Tx, user User, ctx *UseContext) bool
}

type UseContext

type UseContext struct {
	Damage int

	CountSub int

	IgnoreBBox bool

	NewItem Stack

	ConsumedItems []Stack

	NewItemSurvivalOnly bool

	FirstFunc func(comparable func(Stack) bool) (Stack, bool)

	SwapHeldWithArmour func(i int)
}

func (*UseContext) Consume

func (ctx *UseContext) Consume(s Stack)

func (*UseContext) DamageItem

func (ctx *UseContext) DamageItem(d int)

func (*UseContext) SubtractFromCount

func (ctx *UseContext) SubtractFromCount(d int)

type User

type User interface {
	Carrier
	SetHeldItems(mainHand, offHand Stack)

	UsingItem() bool
	ReleaseItem()
	UseItem()
}

type WarpedFungusOnAStick

type WarpedFungusOnAStick struct{}

func (WarpedFungusOnAStick) EncodeItem

func (WarpedFungusOnAStick) EncodeItem() (name string, meta int16)

func (WarpedFungusOnAStick) MaxCount

func (WarpedFungusOnAStick) MaxCount() int

type Weapon

type Weapon interface {
	AttackDamage() float64
}

type Wheat

type Wheat struct{}

func (Wheat) CompostChance

func (Wheat) CompostChance() float64

func (Wheat) EncodeItem

func (w Wheat) EncodeItem() (name string, meta int16)

type WrittenBook

type WrittenBook struct {
	Title string

	Author string

	Generation WrittenBookGeneration

	Pages []string
}

func (WrittenBook) DecodeNBT

func (w WrittenBook) DecodeNBT(data map[string]any) any

func (WrittenBook) EncodeItem

func (WrittenBook) EncodeItem() (name string, meta int16)

func (WrittenBook) EncodeNBT

func (w WrittenBook) EncodeNBT() map[string]any

func (WrittenBook) MaxCount

func (WrittenBook) MaxCount() int

func (WrittenBook) Page

func (w WrittenBook) Page(page int) (string, bool)

func (WrittenBook) TotalPages

func (w WrittenBook) TotalPages() int

type WrittenBookGeneration

type WrittenBookGeneration struct {
	// contains filtered or unexported fields
}

func CopyGeneration

func CopyGeneration() WrittenBookGeneration

func CopyOfCopyGeneration

func CopyOfCopyGeneration() WrittenBookGeneration

func OriginalGeneration

func OriginalGeneration() WrittenBookGeneration

func (WrittenBookGeneration) String

func (g WrittenBookGeneration) String() string

func (WrittenBookGeneration) Uint8

func (g WrittenBookGeneration) Uint8() uint8

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL