Riding
com.jsmacrosce.jsmacros.client.api.event.impl.player.EventRiding
Fires from a startRiding return path when the local player attempts to mount, or when the player begins removing an existing vehicle. The mount event does not establish that riding succeeded. state is true for mounting and false for dismounting;
entity is the targeted entity or former vehicle, respectively. The dismount event also fires for externally caused dismounts.
js
JsMacros.on("Riding", JavaWrapper.methodToJava(function (event) {
if (event.state) {
Chat.log(`Mounting ${event.entity.getType()}`);
} else {
Chat.log(`Dismounted from ${event.entity.getType()}`);
}
}))Constructors
new EventRiding
Initializes the event with the supplied state and a wrapped entity; this does not perform a mount or dismount.
Parameters:
state:truefor mounting orfalsefor dismounting; this flag does not establish that riding succeededentity: raw Minecraft entity to wrap: target when mounting or former vehicle when dismounting;nullfails with NullPointerException during wrapping
Fields
entity
The mounted entity when state is
true, or the former vehicle when it is false. It is wrapped in the corresponding EntityHelper subclass.state
true when the player started riding, false when the player dismounted.