scripting

package
v1.44.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2025 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EntityFlags = []string{}/* 118 elements not displayed */
View Source
var EntityKeys = []string{}/* 132 elements not displayed */

Functions

This section is empty.

Types

type VM

type VM struct {
	CB struct {
		OnEntityAdd        func(entity *entity.Entity, metadata *goja.Object, timeReceived float64) (apply goja.Value)
		OnChunkAdd         func(pos world.ChunkPos, timeReceived float64) (apply goja.Value)
		OnEntityDataUpdate func(entity *entity.Entity, metadata *goja.Object, timeReceived float64)
		OnBlockUpdate      func(name string, properties map[string]any, pos protocol.BlockPos, timeReceived float64) (apply goja.Value)
		OnSpawnParticle    func(name string, pos mgl32.Vec3, timeReceived float64)
		OnPacket           func(name string, pk packet.Packet, toServer bool, timeReceived float64) (drop bool)
	}
	// contains filtered or unexported fields
}

func New

func New() *VM

func (*VM) Load

func (v *VM) Load(script string) error

func (*VM) OnBlockUpdate added in v1.39.1

func (v *VM) OnBlockUpdate(name string, properties map[string]any, pos protocol.BlockPos, timeReceived time.Time) (apply bool)

func (*VM) OnChunkAdd added in v1.39.0

func (v *VM) OnChunkAdd(pos world.ChunkPos, timeReceived time.Time) (apply bool)

func (*VM) OnEntityAdd

func (v *VM) OnEntityAdd(entity *entity.Entity, timeReceived time.Time) (apply bool)

func (*VM) OnEntityDataUpdate

func (v *VM) OnEntityDataUpdate(entity *entity.Entity, timeReceived time.Time)

func (*VM) OnPacket added in v1.40.0

func (v *VM) OnPacket(pk packet.Packet, toServer bool, timeReceived time.Time) (drop bool)

func (*VM) OnSpawnParticle added in v1.39.1

func (v *VM) OnSpawnParticle(name string, position mgl32.Vec3, timeReceived time.Time)

Jump to

Keyboard shortcuts

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