entity

package
v0.0.0-...-54241fc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(typ string, f newf)

Types

type Entity

type Entity interface {
	Tick(srv server, tick uint)
	UUID() uuid.UUID
	EntityID() int32
	Type() string

	Position() (x, y, z float64)
	Rotation() (yaw, pitch float32)
	OnGround() bool
	SetPosition(x, y, z float64)
}

func CreateEntity

func CreateEntity(entityController *controller.Controller[int32, Entity], id int32, data chunk.Entity, d *world.Dimension) Entity

func NewEntity

func NewEntity(data chunk.Entity, id int32, uuid uuid.UUID, d *world.Dimension) Entity

type LivingEntity

type LivingEntity interface {
	Entity
	Kill()
	Attack(attacker LivingEntity)
	Health() float32
	SetHealth(f float32)
}

type UnknownEntity

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

func (*UnknownEntity) EntityID

func (e *UnknownEntity) EntityID() int32

func (*UnknownEntity) OnGround

func (e *UnknownEntity) OnGround() (ong bool)

func (*UnknownEntity) Position

func (e *UnknownEntity) Position() (x, y, z float64)

func (*UnknownEntity) Rotation

func (e *UnknownEntity) Rotation() (yaw, pitch float32)

func (*UnknownEntity) SetPosition

func (e *UnknownEntity) SetPosition(x, y, z float64)

func (*UnknownEntity) Tick

func (e *UnknownEntity) Tick(srv server, tick uint)

func (*UnknownEntity) Type

func (e *UnknownEntity) Type() string

func (*UnknownEntity) UUID

func (e *UnknownEntity) UUID() uuid.UUID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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