entity

package
v1.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AllayType           = MobType{/* contains filtered or unexported fields */}
	ArmadilloType       = MobType{/* contains filtered or unexported fields */}
	AxolotlType         = MobType{/* contains filtered or unexported fields */}
	BatType             = MobType{/* contains filtered or unexported fields */}
	BeeType             = MobType{/* contains filtered or unexported fields */}
	BlazeType           = MobType{/* contains filtered or unexported fields */}
	BoggedType          = MobType{/* contains filtered or unexported fields */}
	BreezeType          = MobType{/* contains filtered or unexported fields */}
	CamelType           = MobType{/* contains filtered or unexported fields */}
	CatType             = MobType{/* contains filtered or unexported fields */}
	CaveSpiderType      = MobType{/* contains filtered or unexported fields */}
	ChickenType         = MobType{/* contains filtered or unexported fields */}
	CodType             = MobType{/* contains filtered or unexported fields */}
	CowType             = MobType{/* contains filtered or unexported fields */}
	CreakingType        = MobType{/* contains filtered or unexported fields */}
	CreeperType         = MobType{/* contains filtered or unexported fields */}
	DolphinType         = MobType{/* contains filtered or unexported fields */}
	DonkeyType          = MobType{/* contains filtered or unexported fields */}
	DrownedType         = MobType{/* contains filtered or unexported fields */}
	ElderGuardianType   = MobType{/* contains filtered or unexported fields */}
	EnderDragonType     = MobType{/* contains filtered or unexported fields */}
	EndermanType        = MobType{/* contains filtered or unexported fields */}
	EndermiteType       = MobType{/* contains filtered or unexported fields */}
	EvokerType          = MobType{/* contains filtered or unexported fields */}
	FoxType             = MobType{/* contains filtered or unexported fields */}
	FrogType            = MobType{/* contains filtered or unexported fields */}
	GhastType           = MobType{/* contains filtered or unexported fields */}
	GlowSquidType       = MobType{/* contains filtered or unexported fields */}
	GoatType            = MobType{/* contains filtered or unexported fields */}
	GuardianType        = MobType{/* contains filtered or unexported fields */}
	HoglinType          = MobType{/* contains filtered or unexported fields */}
	HorseType           = MobType{/* contains filtered or unexported fields */}
	HuskType            = MobType{/* contains filtered or unexported fields */}
	IronGolemType       = MobType{/* contains filtered or unexported fields */}
	LlamaType           = MobType{/* contains filtered or unexported fields */}
	MagmaCubeType       = MobType{/* contains filtered or unexported fields */}
	MooshroomType       = MobType{/* contains filtered or unexported fields */}
	MuleType            = MobType{/* contains filtered or unexported fields */}
	OcelotType          = MobType{/* contains filtered or unexported fields */}
	PandaType           = MobType{/* contains filtered or unexported fields */}
	ParrotType          = MobType{/* contains filtered or unexported fields */}
	PhantomType         = MobType{/* contains filtered or unexported fields */}
	PigType             = MobType{/* contains filtered or unexported fields */}
	PiglinBruteType     = MobType{/* contains filtered or unexported fields */}
	PiglinType          = MobType{/* contains filtered or unexported fields */}
	PillagerType        = MobType{/* contains filtered or unexported fields */}
	PolarBearType       = MobType{/* contains filtered or unexported fields */}
	PufferfishType      = MobType{/* contains filtered or unexported fields */}
	RabbitType          = MobType{/* contains filtered or unexported fields */}
	RavagerType         = MobType{/* contains filtered or unexported fields */}
	SalmonType          = MobType{/* contains filtered or unexported fields */}
	SheepType           = MobType{/* contains filtered or unexported fields */}
	ShulkerType         = MobType{/* contains filtered or unexported fields */}
	SilverfishType      = MobType{/* contains filtered or unexported fields */}
	SkeletonHorseType   = MobType{/* contains filtered or unexported fields */}
	SkeletonType        = MobType{/* contains filtered or unexported fields */}
	SlimeType           = MobType{/* contains filtered or unexported fields */}
	SnifferType         = MobType{/* contains filtered or unexported fields */}
	SnowGolemType       = MobType{/* contains filtered or unexported fields */}
	SpiderType          = MobType{/* contains filtered or unexported fields */}
	SquidType           = MobType{/* contains filtered or unexported fields */}
	StrayType           = MobType{/* contains filtered or unexported fields */}
	StriderType         = MobType{/* contains filtered or unexported fields */}
	TadpoleType         = MobType{/* contains filtered or unexported fields */}
	TraderLlamaType     = MobType{/* contains filtered or unexported fields */}
	TropicalFishType    = MobType{/* contains filtered or unexported fields */}
	TurtleType          = MobType{/* contains filtered or unexported fields */}
	VexType             = MobType{/* contains filtered or unexported fields */}
	VillagerType        = MobType{/* contains filtered or unexported fields */}
	VindicatorType      = MobType{/* contains filtered or unexported fields */}
	WanderingTraderType = MobType{/* contains filtered or unexported fields */}
	WardenType          = MobType{/* contains filtered or unexported fields */}
	WitchType           = MobType{/* contains filtered or unexported fields */}
	WitherType          = MobType{/* contains filtered or unexported fields */}
	WitherSkeletonType  = MobType{/* contains filtered or unexported fields */}
	WolfType            = MobType{/* contains filtered or unexported fields */}
	ZoglinType          = MobType{/* contains filtered or unexported fields */}
	ZombieHorseType     = MobType{/* contains filtered or unexported fields */}
	ZombiePigmanType    = MobType{/* contains filtered or unexported fields */}
	ZombieType          = MobType{/* contains filtered or unexported fields */}
	ZombieVillagerType  = MobType{/* contains filtered or unexported fields */}
)
View Source
var AreaEffectCloudType areaEffectCloudType
View Source
var ArrowType arrowType
View Source
var BottleOfEnchantingType bottleOfEnchantingType
View Source
var EggType eggType
View Source
var EnderPearlType enderPearlType
View Source
var ExperienceOrbType experienceOrbType
View Source
var FallingBlockType fallingBlockType
View Source
var FireworkType fireworkType
View Source
var ItemType itemType
View Source
var LightningType lightningType
View Source
var LingeringPotionType lingeringPotionType
View Source
var MobBehaviourConfig = PassiveBehaviourConfig{Gravity: 0.08, Drag: 0.02}
View Source
var SnowballType snowballType
View Source
var SplashPotionType splashPotionType
View Source
var TNTType tntType
View Source
var TextType textType

Functions

func EyePosition

func EyePosition(e world.Entity) mgl64.Vec3

func NewAreaEffectCloud

func NewAreaEffectCloud(opts world.EntitySpawnOpts, p potion.Potion) *world.EntityHandle

func NewAreaEffectCloudWith

func NewAreaEffectCloudWith(opts world.EntitySpawnOpts, t potion.Potion, duration, reapplicationDelay, durationOnUse time.Duration, radius, radiusOnUse, radiusGrowth float64) *world.EntityHandle

func NewArrow

func NewArrow(opts world.EntitySpawnOpts, owner world.Entity) *world.EntityHandle

func NewArrowWithDamage

func NewArrowWithDamage(opts world.EntitySpawnOpts, damage float64, owner world.Entity) *world.EntityHandle

func NewBottleOfEnchanting

func NewBottleOfEnchanting(opts world.EntitySpawnOpts, owner world.Entity) *world.EntityHandle

func NewEgg

func NewEgg(opts world.EntitySpawnOpts, owner world.Entity) *world.EntityHandle

func NewEnderPearl

func NewEnderPearl(opts world.EntitySpawnOpts, owner world.Entity) *world.EntityHandle

func NewExperienceOrb

func NewExperienceOrb(opts world.EntitySpawnOpts, xp int) *world.EntityHandle

func NewExperienceOrbs

func NewExperienceOrbs(pos mgl64.Vec3, amount int) (orbs []*world.EntityHandle)

func NewFallingBlock

func NewFallingBlock(opts world.EntitySpawnOpts, block world.Block) *world.EntityHandle

func NewFirework

func NewFirework(opts world.EntitySpawnOpts, firework item.Firework) *world.EntityHandle

func NewFireworkAttached

func NewFireworkAttached(opts world.EntitySpawnOpts, firework item.Firework, owner world.Entity) *world.EntityHandle

func NewItem

func NewItemPickupDelay

func NewItemPickupDelay(opts world.EntitySpawnOpts, i item.Stack, delay time.Duration) *world.EntityHandle

func NewLightning

func NewLightning(opts world.EntitySpawnOpts) *world.EntityHandle

func NewLightningWithDamage

func NewLightningWithDamage(opts world.EntitySpawnOpts, dmg float64, blockFire bool, entityFireDuration time.Duration) *world.EntityHandle

func NewLingeringPotion

func NewLingeringPotion(opts world.EntitySpawnOpts, t potion.Potion, owner world.Entity) *world.EntityHandle

func NewSnowball

func NewSnowball(opts world.EntitySpawnOpts, owner world.Entity) *world.EntityHandle

func NewSplashPotion

func NewSplashPotion(opts world.EntitySpawnOpts, t potion.Potion, owner world.Entity) *world.EntityHandle

func NewTNT

func NewText

func NewText(text string, pos mgl64.Vec3) *world.EntityHandle

func NewTippedArrow

func NewTippedArrow(opts world.EntitySpawnOpts, owner world.Entity, tip potion.Potion) *world.EntityHandle

func NewTippedArrowWithDamage

func NewTippedArrowWithDamage(opts world.EntitySpawnOpts, damage float64, owner world.Entity, tip potion.Potion) *world.EntityHandle

Types

type AreaEffectCloudBehaviour

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

func (*AreaEffectCloudBehaviour) Effects

func (a *AreaEffectCloudBehaviour) Effects() []effect.Effect

func (*AreaEffectCloudBehaviour) PortalTravelComputer

func (a *AreaEffectCloudBehaviour) PortalTravelComputer() *PortalTravelComputer

func (*AreaEffectCloudBehaviour) Radius

func (a *AreaEffectCloudBehaviour) Radius() float64

func (*AreaEffectCloudBehaviour) Tick

func (a *AreaEffectCloudBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type AreaEffectCloudBehaviourConfig

type AreaEffectCloudBehaviourConfig struct {
	Potion potion.Potion

	Radius float64

	RadiusUseGrowth float64

	RadiusTickGrowth float64

	Duration time.Duration

	DurationUseGrowth time.Duration

	ReapplicationDelay time.Duration
}

func (AreaEffectCloudBehaviourConfig) Apply

func (AreaEffectCloudBehaviourConfig) New

type ArrowShakeAction

type ArrowShakeAction struct {
	Duration time.Duration
	// contains filtered or unexported fields
}

func (ArrowShakeAction) EntityAction

func (ArrowShakeAction) EntityAction()

type AttackDamageSource

type AttackDamageSource struct {
	Attacker world.Entity
}

func (AttackDamageSource) Fire

func (AttackDamageSource) Fire() bool

func (AttackDamageSource) IgnoreTotem

func (AttackDamageSource) IgnoreTotem() bool

func (AttackDamageSource) ReducedByArmour

func (AttackDamageSource) ReducedByArmour() bool

func (AttackDamageSource) ReducedByResistance

func (AttackDamageSource) ReducedByResistance() bool

type BaseBehaviour

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

func NewBaseBehaviour

func NewBaseBehaviour() BaseBehaviour

func (*BaseBehaviour) PortalTravelComputer

func (b *BaseBehaviour) PortalTravelComputer() *PortalTravelComputer

type Behaviour

type Behaviour interface {
	Tick(e *Ent, tx *world.Tx) *Movement
}

type Collector

type Collector interface {
	world.Entity

	Collect(stack item.Stack) (n int, ok bool)
}

type CriticalHitAction

type CriticalHitAction struct {
	Count int
	// contains filtered or unexported fields
}

func (CriticalHitAction) EntityAction

func (CriticalHitAction) EntityAction()

type DeathAction

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

func (DeathAction) EntityAction

func (DeathAction) EntityAction()

type DrowningDamageSource

type DrowningDamageSource struct{}

func (DrowningDamageSource) Fire

func (DrowningDamageSource) Fire() bool

func (DrowningDamageSource) IgnoreTotem

func (DrowningDamageSource) IgnoreTotem() bool

func (DrowningDamageSource) ReducedByArmour

func (DrowningDamageSource) ReducedByArmour() bool

func (DrowningDamageSource) ReducedByResistance

func (DrowningDamageSource) ReducedByResistance() bool

type EatAction

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

func (EatAction) EntityAction

func (EatAction) EntityAction()

type EffectManager

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

func NewEffectManager

func NewEffectManager(eff ...effect.Effect) *EffectManager

func (*EffectManager) Add

func (m *EffectManager) Add(e effect.Effect, entity Living) effect.Effect

func (*EffectManager) Effect

func (m *EffectManager) Effect(e effect.Type) (effect.Effect, bool)

func (*EffectManager) Effects

func (m *EffectManager) Effects() []effect.Effect

func (*EffectManager) Remove

func (m *EffectManager) Remove(e effect.Type, entity Living)

func (*EffectManager) Tick

func (m *EffectManager) Tick(entity Living, tx *world.Tx)

type EnchantedHitAction

type EnchantedHitAction struct {
	Count int
	// contains filtered or unexported fields
}

func (EnchantedHitAction) EntityAction

func (EnchantedHitAction) EntityAction()

type Ent

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

func Open

func Open(tx *world.Tx, handle *world.EntityHandle, data *world.EntityData) *Ent

func (*Ent) Age

func (e *Ent) Age() time.Duration

func (*Ent) AlwaysShowNameTag

func (e *Ent) AlwaysShowNameTag() bool

func (*Ent) Behaviour

func (e *Ent) Behaviour() Behaviour

func (*Ent) Close

func (e *Ent) Close() error

func (*Ent) Explode

func (e *Ent) Explode(src mgl64.Vec3, impact float64, conf block.ExplosionConfig)

func (*Ent) Extinguish

func (e *Ent) Extinguish()

func (*Ent) H

func (e *Ent) H() *world.EntityHandle

func (*Ent) NameTag

func (e *Ent) NameTag() string

func (*Ent) OnFireDuration

func (e *Ent) OnFireDuration() time.Duration

func (*Ent) Position

func (e *Ent) Position() mgl64.Vec3

func (*Ent) Rotation

func (e *Ent) Rotation() cube.Rotation

func (*Ent) SetAlwaysShowNameTag

func (e *Ent) SetAlwaysShowNameTag(alwaysShow bool)

func (*Ent) SetNameTag

func (e *Ent) SetNameTag(s string)

func (*Ent) SetOnFire

func (e *Ent) SetOnFire(duration time.Duration)

func (*Ent) SetVelocity

func (e *Ent) SetVelocity(v mgl64.Vec3)

func (*Ent) Teleport

func (e *Ent) Teleport(pos mgl64.Vec3)

func (*Ent) Tick

func (e *Ent) Tick(tx *world.Tx, current int64)

func (*Ent) TravelThroughPortal

func (e *Ent) TravelThroughPortal(tx *world.Tx, target world.Dimension)

func (*Ent) Velocity

func (e *Ent) Velocity() mgl64.Vec3

type ExperienceManager

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

func NewExperienceManager

func NewExperienceManager() *ExperienceManager

func (*ExperienceManager) Add

func (e *ExperienceManager) Add(amount int) (level int, progress float64)

func (*ExperienceManager) Experience

func (e *ExperienceManager) Experience() int

func (*ExperienceManager) Level

func (e *ExperienceManager) Level() int

func (*ExperienceManager) Progress

func (e *ExperienceManager) Progress() float64

func (*ExperienceManager) Reset

func (e *ExperienceManager) Reset()

func (*ExperienceManager) SetLevel

func (e *ExperienceManager) SetLevel(level int)

func (*ExperienceManager) SetProgress

func (e *ExperienceManager) SetProgress(progress float64)

type ExperienceOrbBehaviour

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

func (*ExperienceOrbBehaviour) Experience

func (exp *ExperienceOrbBehaviour) Experience() int

func (*ExperienceOrbBehaviour) PortalTravelComputer

func (exp *ExperienceOrbBehaviour) PortalTravelComputer() *PortalTravelComputer

func (*ExperienceOrbBehaviour) Tick

func (exp *ExperienceOrbBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type ExperienceOrbBehaviourConfig

type ExperienceOrbBehaviourConfig struct {
	Gravity float64

	Drag float64

	ExistenceDuration time.Duration

	Experience int
}

func (ExperienceOrbBehaviourConfig) Apply

func (conf ExperienceOrbBehaviourConfig) Apply(data *world.EntityData)

func (ExperienceOrbBehaviourConfig) New

type ExplosionDamageSource

type ExplosionDamageSource struct{}

func (ExplosionDamageSource) AffectedByEnchantment

func (ExplosionDamageSource) AffectedByEnchantment(e item.EnchantmentType) bool

func (ExplosionDamageSource) Fire

func (ExplosionDamageSource) Fire() bool

func (ExplosionDamageSource) IgnoreTotem

func (ExplosionDamageSource) IgnoreTotem() bool

func (ExplosionDamageSource) ReducedByArmour

func (ExplosionDamageSource) ReducedByArmour() bool

func (ExplosionDamageSource) ReducedByResistance

func (ExplosionDamageSource) ReducedByResistance() bool

type Eyed

type Eyed interface {
	EyeHeight() float64
}

type FallDamageSource

type FallDamageSource struct{}

func (FallDamageSource) AffectedByEnchantment

func (FallDamageSource) AffectedByEnchantment(e item.EnchantmentType) bool

func (FallDamageSource) Fire

func (FallDamageSource) Fire() bool

func (FallDamageSource) IgnoreTotem

func (FallDamageSource) IgnoreTotem() bool

func (FallDamageSource) ReducedByArmour

func (FallDamageSource) ReducedByArmour() bool

func (FallDamageSource) ReducedByResistance

func (FallDamageSource) ReducedByResistance() bool

type FallingBlockBehaviour

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

func (*FallingBlockBehaviour) Block

func (f *FallingBlockBehaviour) Block() world.Block

func (*FallingBlockBehaviour) Tick

func (f *FallingBlockBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type FallingBlockBehaviourConfig

type FallingBlockBehaviourConfig struct {
	Block world.Block

	Gravity float64

	Drag float64

	DistanceFallen float64
}

func (FallingBlockBehaviourConfig) Apply

func (conf FallingBlockBehaviourConfig) Apply(data *world.EntityData)

func (FallingBlockBehaviourConfig) New

type FireworkBehaviour

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

func (*FireworkBehaviour) Attached

func (f *FireworkBehaviour) Attached() bool

func (*FireworkBehaviour) Firework

func (f *FireworkBehaviour) Firework() item.Firework

func (*FireworkBehaviour) Owner

func (f *FireworkBehaviour) Owner() *world.EntityHandle

func (*FireworkBehaviour) PortalTravelComputer

func (f *FireworkBehaviour) PortalTravelComputer() *PortalTravelComputer

func (*FireworkBehaviour) Tick

func (f *FireworkBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type FireworkBehaviourConfig

type FireworkBehaviourConfig struct {
	Firework item.Firework
	Owner    *world.EntityHandle

	ExistenceDuration time.Duration

	SidewaysVelocityMultiplier float64

	UpwardsAcceleration float64

	Attached bool
}

func (FireworkBehaviourConfig) Apply

func (conf FireworkBehaviourConfig) Apply(data *world.EntityData)

func (FireworkBehaviourConfig) New

type FireworkExplosionAction

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

func (FireworkExplosionAction) EntityAction

func (FireworkExplosionAction) EntityAction()

type Flammable

type Flammable interface {
	OnFireDuration() time.Duration

	SetOnFire(duration time.Duration)

	Extinguish()
}

type FoodHealingSource

type FoodHealingSource struct{ QuickRegeneration bool }

func (FoodHealingSource) HealingSource

func (FoodHealingSource) HealingSource()

type GlideDamageSource

type GlideDamageSource struct{}

func (GlideDamageSource) Fire

func (GlideDamageSource) Fire() bool

func (GlideDamageSource) IgnoreTotem

func (GlideDamageSource) IgnoreTotem() bool

func (GlideDamageSource) ReducedByArmour

func (GlideDamageSource) ReducedByArmour() bool

func (GlideDamageSource) ReducedByResistance

func (GlideDamageSource) ReducedByResistance() bool

type HealthManager

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

func NewHealthManager

func NewHealthManager(health, max float64) *HealthManager

func (*HealthManager) AddHealth

func (m *HealthManager) AddHealth(health float64)

func (*HealthManager) Health

func (m *HealthManager) Health() float64

func (*HealthManager) MaxHealth

func (m *HealthManager) MaxHealth() float64

func (*HealthManager) SetMaxHealth

func (m *HealthManager) SetMaxHealth(max float64)

type HurtAction

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

func (HurtAction) EntityAction

func (HurtAction) EntityAction()

type ItemBehaviour

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

func (*ItemBehaviour) Explode

func (i *ItemBehaviour) Explode(e *Ent, src mgl64.Vec3, impact float64, conf block.ExplosionConfig)

func (*ItemBehaviour) Item

func (i *ItemBehaviour) Item() item.Stack

func (*ItemBehaviour) PortalTravelComputer

func (i *ItemBehaviour) PortalTravelComputer() *PortalTravelComputer

func (*ItemBehaviour) Tick

func (i *ItemBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type ItemBehaviourConfig

type ItemBehaviourConfig struct {
	Item item.Stack

	Gravity float64

	Drag float64

	ExistenceDuration time.Duration

	PickupDelay time.Duration
}

func (ItemBehaviourConfig) Apply

func (conf ItemBehaviourConfig) Apply(data *world.EntityData)

func (ItemBehaviourConfig) New

func (conf ItemBehaviourConfig) New() *ItemBehaviour

type LightningDamageSource

type LightningDamageSource struct{}

func (LightningDamageSource) Fire

func (LightningDamageSource) Fire() bool

func (LightningDamageSource) IgnoreTotem

func (LightningDamageSource) IgnoreTotem() bool

func (LightningDamageSource) ReducedByArmour

func (LightningDamageSource) ReducedByArmour() bool

func (LightningDamageSource) ReducedByResistance

func (LightningDamageSource) ReducedByResistance() bool

type Living

type Living interface {
	world.Entity

	Health() float64

	MaxHealth() float64

	SetMaxHealth(v float64)

	Dead() bool

	Hurt(damage float64, src world.DamageSource) (n float64, vulnerable bool)

	Heal(health float64, src world.HealingSource) float64

	KnockBack(src mgl64.Vec3, force, height float64)

	Velocity() mgl64.Vec3

	SetVelocity(velocity mgl64.Vec3)

	AddEffect(e effect.Effect)

	RemoveEffect(e effect.Type)

	Effects() []effect.Effect

	Speed() float64

	SetSpeed(float64)
}

type Mob

type Mob struct{ *Ent }

type MobType

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

func MobByName

func MobByName(name string) (MobType, bool)

func MobTypes

func MobTypes() []MobType

func (MobType) BBox

func (t MobType) BBox(world.Entity) cube.BBox

func (MobType) DecodeNBT

func (t MobType) DecodeNBT(_ map[string]any, data *world.EntityData)

func (MobType) EncodeEntity

func (t MobType) EncodeEntity() string

func (MobType) EncodeNBT

func (t MobType) EncodeNBT(_ *world.EntityData) map[string]any

func (MobType) Open

func (t MobType) Open(tx *world.Tx, handle *world.EntityHandle, data *world.EntityData) world.Entity

type Movement

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

func (*Movement) Position

func (m *Movement) Position() mgl64.Vec3

func (*Movement) Rotation

func (m *Movement) Rotation() cube.Rotation

func (*Movement) Send

func (m *Movement) Send()

func (*Movement) Velocity

func (m *Movement) Velocity() mgl64.Vec3

type MovementComputer

type MovementComputer struct {
	Gravity, Drag     float64
	DragBeforeGravity bool
	// contains filtered or unexported fields
}

func (*MovementComputer) CheckCollision

func (c *MovementComputer) CheckCollision(tx *world.Tx, e world.Entity, pos, vel mgl64.Vec3) (mgl64.Vec3, mgl64.Vec3)

func (*MovementComputer) OnGround

func (c *MovementComputer) OnGround() bool

func (*MovementComputer) TickMovement

func (c *MovementComputer) TickMovement(e world.Entity, pos, vel mgl64.Vec3, rot cube.Rotation, tx *world.Tx) *Movement

type PassiveBehaviour

type PassiveBehaviour struct {
	BaseBehaviour
	// contains filtered or unexported fields
}

func (*PassiveBehaviour) Explode

func (p *PassiveBehaviour) Explode(e *Ent, src mgl64.Vec3, impact float64, _ block.ExplosionConfig)

func (*PassiveBehaviour) Fuse

func (p *PassiveBehaviour) Fuse() time.Duration

func (*PassiveBehaviour) Tick

func (p *PassiveBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type PassiveBehaviourConfig

type PassiveBehaviourConfig struct {
	Gravity float64

	Drag float64

	ExistenceDuration time.Duration

	Expire func(e *Ent, tx *world.Tx)

	Tick func(e *Ent, tx *world.Tx)
}

func (PassiveBehaviourConfig) Apply

func (conf PassiveBehaviourConfig) Apply(data *world.EntityData)

func (PassiveBehaviourConfig) New

type PickedUpAction

type PickedUpAction struct {
	Collector world.Entity
	// contains filtered or unexported fields
}

func (PickedUpAction) EntityAction

func (PickedUpAction) EntityAction()

type PortalTravelComputer

type PortalTravelComputer struct {
	Instantaneous func(source, target world.Dimension) bool

	Teleport func(e Traveller, pos mgl64.Vec3)

	SpawnPoint func(tx *world.Tx) mgl64.Vec3

	Player bool

	CreatePortal bool

	Cooldown time.Duration
	// contains filtered or unexported fields
}

func NewPortalTravelComputer

func NewPortalTravelComputer() *PortalTravelComputer

func (*PortalTravelComputer) EnterPortal

func (t *PortalTravelComputer) EnterPortal(e Traveller, tx *world.Tx, target world.Dimension)

func (*PortalTravelComputer) StopPortalContact

func (t *PortalTravelComputer) StopPortalContact()

type ProjectileBehaviour

type ProjectileBehaviour struct {
	BaseBehaviour
	// contains filtered or unexported fields
}

func (*ProjectileBehaviour) Critical

func (lt *ProjectileBehaviour) Critical() bool

func (*ProjectileBehaviour) Explode

func (lt *ProjectileBehaviour) Explode(e *Ent, src mgl64.Vec3, impact float64, _ block.ExplosionConfig)

func (*ProjectileBehaviour) HandlePortalTravel

func (lt *ProjectileBehaviour) HandlePortalTravel(world.Dimension, world.Dimension)

func (*ProjectileBehaviour) Owner

func (lt *ProjectileBehaviour) Owner() *world.EntityHandle

func (*ProjectileBehaviour) PortalTravel

func (lt *ProjectileBehaviour) PortalTravel() bool

func (*ProjectileBehaviour) Potion

func (lt *ProjectileBehaviour) Potion() potion.Potion

func (*ProjectileBehaviour) Tick

func (lt *ProjectileBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type ProjectileBehaviourConfig

type ProjectileBehaviourConfig struct {
	Owner *world.EntityHandle

	Gravity float64

	Drag float64

	Damage float64

	Potion potion.Potion

	KnockBackForceAddend float64

	KnockBackHeightAddend float64

	Particle world.Particle

	ParticleCount int

	Sound world.Sound

	Critical bool

	Hit func(e *Ent, tx *world.Tx, target trace.Result)

	SurviveBlockCollision bool

	BlockCollisionVelocityMultiplier float64

	DisablePickup bool

	PickupItem item.Stack

	CollisionPosition cube.Pos

	PiercingLevel int
}

func (ProjectileBehaviourConfig) Apply

func (conf ProjectileBehaviourConfig) Apply(data *world.EntityData)

func (ProjectileBehaviourConfig) New

type ProjectileDamageSource

type ProjectileDamageSource struct {
	Projectile, Owner world.Entity
}

func (ProjectileDamageSource) AffectedByEnchantment

func (ProjectileDamageSource) AffectedByEnchantment(e item.EnchantmentType) bool

func (ProjectileDamageSource) Fire

func (ProjectileDamageSource) IgnoreTotem

func (ProjectileDamageSource) IgnoreTotem() bool

func (ProjectileDamageSource) ReducedByArmour

func (ProjectileDamageSource) ReducedByArmour() bool

func (ProjectileDamageSource) ReducedByResistance

func (ProjectileDamageSource) ReducedByResistance() bool

type Solidifiable

type Solidifiable interface {
	Solidifies(pos cube.Pos, tx *world.Tx) bool
}

type SplashableBlock

type SplashableBlock interface {
	world.Block

	Splash(tx *world.Tx, pos cube.Pos)
}

type SplashableEntity

type SplashableEntity interface {
	world.Entity

	Splash(tx *world.Tx, pos mgl64.Vec3)
}

type StationaryBehaviour

type StationaryBehaviour struct {
	BaseBehaviour
	// contains filtered or unexported fields
}

func (*StationaryBehaviour) Immobile

func (s *StationaryBehaviour) Immobile() bool

func (*StationaryBehaviour) Tick

func (s *StationaryBehaviour) Tick(e *Ent, tx *world.Tx) *Movement

type StationaryBehaviourConfig

type StationaryBehaviourConfig struct {
	ExistenceDuration time.Duration

	SpawnSounds []world.Sound

	Tick func(e *Ent, tx *world.Tx)
}

func (StationaryBehaviourConfig) Apply

func (conf StationaryBehaviourConfig) Apply(data *world.EntityData)

func (StationaryBehaviourConfig) New

type SuffocationDamageSource

type SuffocationDamageSource struct{}

func (SuffocationDamageSource) Fire

func (SuffocationDamageSource) IgnoreTotem

func (SuffocationDamageSource) IgnoreTotem() bool

func (SuffocationDamageSource) ReducedByArmour

func (SuffocationDamageSource) ReducedByArmour() bool

func (SuffocationDamageSource) ReducedByResistance

func (SuffocationDamageSource) ReducedByResistance() bool

type SwingArmAction

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

func (SwingArmAction) EntityAction

func (SwingArmAction) EntityAction()

type TotemUseAction

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

func (TotemUseAction) EntityAction

func (TotemUseAction) EntityAction()

type Traveller

type Traveller interface {
	world.Entity

	Teleport(pos mgl64.Vec3)
}

type VoidDamageSource

type VoidDamageSource struct{}

func (VoidDamageSource) Fire

func (VoidDamageSource) Fire() bool

func (VoidDamageSource) IgnoreTotem

func (VoidDamageSource) IgnoreTotem() bool

func (VoidDamageSource) ReducedByArmour

func (VoidDamageSource) ReducedByArmour() bool

func (VoidDamageSource) ReducedByResistance

func (VoidDamageSource) ReducedByResistance() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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