EventHandler Class
Access to the internal event handling system
Item Index
Methods
Methods
Events
Comcraft.displayScreen
Fired whenever the screen is changed. If this event returns a new GuiScreen, use that one instead.
Event Payload:
-
newGuiScreen
GuiScreen
Game.Command
When a command is entered by the user in the current world
Event Payload:
-
command
String
Game.Player.moveEntity
Fired whenever the player presses any of the movement buttons. Either by touch or by keyboard.
Event Payload:
-
player
EntityPlayerthe player attempting to move.
-
movVec
Vec3DThe direction of movement where x = strafe, y = up and z = forward
Game.Player.updateEntityMove
Fired continually (every game tick) to update the player's movement. The player's current
velocity is described by vVec
(0, 0, 0) is stationary.
slowVec
is subtracted from vVec after this event to cause slowness.
If one or more components of slowVec
are negative, that would result in acceleration in those
component directions otherwise, deceleration would occur.
Event Payload:
-
player
EntityPlayerThe player being updated
-
slowVec
Vec3DThe slowness vector
-
vVec
Vec3DThe player's velocity vector
Player.Construct
Fired when constructing a player. Use this event to modify initial properties of the player.
Event Payload:
-
player
EntityPlayerThe player being constructed.
Render.Init
When the render engine is initialised, this event is triggered.
Event Payload:
-
background
Background
World.Generate
This event is called when a new world has been defined and is called with these arguments:
Event Payload:
-
isFlat
Booleanwhether the user selected flat world
-
chunkGenerator
ChunkGeneratorNormal | ChunkGeneratorFlatan instance of a chunk generator. If isFlat == true then chunkGenerator is ChunkGeneratorFlat, otherwise ChunkGeneratorNormal