grounds

An extensible MUSH / MUD server written in Java.


Project maintained by bhavanki Hosted on GitHub Pages — Theme by mattgraham

Events

Commands are what makes things happen in a Grounds universe, and many commands generate events describing what happens. Events on their own are invisible to players, but listener attributes on extensions can react to events by running plugins, which may in turn run more commands. This helps to make a universe feel more alive, beyond the players in it.

Event Types

Every event has a type which describes what happened to trigger it. These are usually tied to the command that caused the event to be posted in the first place, but some events are not tied to a command.

TypeCommandCause
ArrivalEventn/aA player arrived (logged in)
DepartureEventn/aA player departed (logged out)
DroppedThingEventDROPA thing was dropped by a player
SayMessageEventSAYA message was said
TakenThingEventTAKEA thing was taken by a player
TeleportArrivalEventTELEPORTA thing arrived at a location
TeleportDepartureEventTELEPORTA thing departed from a location
YoinkArrivalEventYOINKA yoinked thing arrived at a location
YoinkDepartureEventYOINKA yoinked thing departed from a location

Note: In Grounds, the MOVE command causes a TELEPORT, so ordinary player movement also triggers Teleport* events.

Event Payload

Every event has a JSON object called a payload with context about the event, beyond the type. Each event type may have its own payload structure. The following fields are standard, but they are not necessarily present in every event.

Field nameDefinition
locationname of location where event occurred
locationIdID of location where event occurred
playername of player who caused event
playerIdID of player who caused event

Here are the payload fields provided by the different event types.

TypePlayerLocationOther
ArrivalEventarriving playern/an/a
DepartureEventdeparting playern/an/a
DroppedThingEventdropping playerdropping location
  • thingId = ID of dropped thing
  • thingName = name of dropped thing
SayMessageEventsaying playersaying location
  • message = said message
TakenThingEventtaking playertaking location
  • thingId = ID of taken thing
  • thingName = name of taken thing
TeleportArrivalEventarriving playerlocation of arrivalnone
TeleportDepartureEventdeparting playerlocation of departurenone
YoinkArrivalEventnot presentlocation of arrival
  • yoinkedThingId = ID of arriving thing
  • yoinkedThingName = name of arriving thing
  • yoinkedThingType = type (as simple class name) of arriving thing
YoinkDepartureEventnot presentlocation of departure
  • yoinkedThingId = ID of departing thing
  • yoinkedThingName = name of departing thing
  • yoinkedThingType = type (as simple class name) of departing thing