Skip to content

server.world.particle

interface Particle #

interface Particle {
	// event_id returns the level event the client renders the particle for.
	event_id() int
	// data returns the payload of that level event, empty for particles that
	// need none.
	data() int
}

Particle is an effect that may be shown at a position in a world. Like sounds, particles are plain values: one may be built once and shown to several viewers.

struct BlockBreak #

struct BlockBreak {
pub:
	block_runtime_id int
}

BlockBreak is the burst of block fragments shown when a block is broken. The runtime id decides which texture the fragments use.

fn (BlockBreak) event_id #

fn (p BlockBreak) event_id() int

fn (BlockBreak) data #

fn (p BlockBreak) data() int

struct Custom #

struct Custom {
pub:
	id      int
	payload int
}

Custom is a particle the client renders for a level event the server has no dedicated type for yet. It exists so a caller is never forced back to building level event packets by hand.

fn (Custom) event_id #

fn (p Custom) event_id() int

fn (Custom) data #

fn (p Custom) data() int

struct PunchBlock #

struct PunchBlock {
pub:
	block_runtime_id int
	face             int
}

PunchBlock is the small puff of fragments shown while a block is being mined, coming off the face that is being hit.

fn (PunchBlock) event_id #

fn (p PunchBlock) event_id() int

fn (PunchBlock) data #

fn (p PunchBlock) data() int