Documentation
¶
Index ¶
- Variables
- func NewEntityId() int32
- type Attribute
- type Entity
- func (p *Entity) Attribute(id string) *Attribute
- func (p *Entity) Attributes() []Attribute
- func (p *Entity) DimensionName() string
- func (p *Entity) Metadata() metadata.Metadata
- func (p *Entity) MetadataIndex(i byte) any
- func (p *Entity) Motion() (vx, vy, vz float64)
- func (p *Entity) OnGround() bool
- func (p *Entity) Position() (x, y, z float64)
- func (p *Entity) Rotation() (yaw, pitch float32)
- func (p *Entity) SetAttribute(id string, base float64)
- func (p *Entity) SetDimensionName(v string)
- func (p *Entity) SetMetadata(md metadata.Metadata)
- func (p *Entity) SetMetadataIndex(i byte, v any)
- func (p *Entity) SetMetadataIndexes(md metadata.Metadata)
- func (p *Entity) SetMotion(x, y, z float64)
- func (p *Entity) SetOnGround(v bool)
- func (p *Entity) SetPosition(x, y, z float64)
- func (p *Entity) SetRotation(yaw, pitch float32)
- func (p *Entity) Type() int32
- func (p *Entity) UUID() uuid.UUID
- type LevelEntity
- type LivingEntity
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultAttributes = map[string]float64{
"minecraft:generic.armor": 0,
"minecraft:generic.armor_toughness": 0,
"minecraft:generic.attack_damage": 2,
"minecraft:generic.attack_knockback": 0,
"minecraft:generic.attack_speed": 2,
"minecraft:generic.block_break_speed": 1,
"minecraft:generic.block_interaction_range": 4.5,
"minecraft:generic.entity_interaction_range": 3,
"minecraft:generic.fall_damage_multiplier": 1,
"minecraft:generic.flying_speed": 0.4,
"minecraft:generic.follow_range": 32,
"minecraft:generic.gravity": 0.08,
"minecraft:generic.jump_strength": 0.42,
"minecraft:generic.knockback_resistance": 0,
"minecraft:generic.luck": 0,
"minecraft:generic.max_absorption": 0,
"minecraft:generic.max_health": 20,
"minecraft:generic.movement_speed": 0.7,
"minecraft:generic.safe_fall_distance": 3,
"minecraft:generic.scale": 1,
"minecraft:zombie.spawn_reinforcements": 0,
"minecraft:generic.step_height": 0.6,
"minecraft:generic.submerged_mining_speed": 0.2,
"minecraft:generic.sweeping_damage_ratio": 0,
"minecraft:generic.water_movement_efficiency": 0,
}
Functions ¶
func NewEntityId ¶
func NewEntityId() int32
Types ¶
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
Entity is the base state for entities
func (*Entity) Attributes ¶
Attributes returns a clone of the attributes of this state
func (*Entity) DimensionName ¶
func (*Entity) MetadataIndex ¶
func (*Entity) SetAttribute ¶
func (*Entity) SetDimensionName ¶
func (*Entity) SetMetadata ¶
func (*Entity) SetMetadataIndex ¶
func (*Entity) SetMetadataIndexes ¶
func (*Entity) SetOnGround ¶
func (*Entity) SetPosition ¶
func (*Entity) SetRotation ¶
type LevelEntity ¶
type LevelEntity struct {
Air int16
CustomName string
CustomNameVisible bool
FallDistance float32
Fire int16
Glowing bool
HasVisualFire bool
Id string `nbt:"id"`
Invulnerable bool
Motion [3]float64
NoGravity bool
OnGround bool
Passengers []Entity
PortalCooldown int32
Pos [3]float64
Rotation [2]float32
Silent bool `nbt:"Silent,omitempty"`
Tags []string
TicksFrozen int32 `nbt:"TicksFrozen,omitempty"`
UUID uuid.UUID
}
type LivingEntity ¶
type LivingEntity struct {
Entity
// contains filtered or unexported fields
}
func NewLiving ¶
func NewLiving(e *Entity) LivingEntity
func (*LivingEntity) Food ¶
func (l *LivingEntity) Food() (food int32, saturation, exhaustion float32)
func (*LivingEntity) Health ¶
func (l *LivingEntity) Health() float32
func (*LivingEntity) SetFood ¶
func (l *LivingEntity) SetFood(food int32, saturation, exhaustion float32)
func (*LivingEntity) SetHealth ¶
func (l *LivingEntity) SetHealth(h float32)
Click to show internal directories.
Click to hide internal directories.