Events are a useful feature that can be used for Cardinal to notify the game client of a certain event or information.

package systems

import ""

func AttackSystem(worldCtx cardinal.WorldContext) {
	// Attack system logic
	// ...
	// Broadcast the event to all players
    worldCtx.EmitEvent(fmt.Sprintf("player attacked: %s %d"))


The EmitEvent method on cardinal.WorldContext will emit events to all clients under the subject “event”.

To see how to receive notifications go here: (Unity)

func (worldCtx cardinal.WorldContext) EmitEvent(event string)
eventstringThe string to emit as an event