-
Notifications
You must be signed in to change notification settings - Fork 2
Event Triggers
Event Triggers in KiteBoard 3
Event Triggers can be used to create powerful event oriented scoreboards, for example when a player joins the server, or when a player enters combat.
The new system introduced in KiteBoard 3 allows you to hook onto any event available in the bukkit ecosystem, including those registered by third party plugins.
What you need to know:
- The fully qualified class name, including package. e.g
org.bukkit.event.player.PlayerJoinEvent
- The method name to retrieve the player we should apply this group to, most commonly:
getPlayer
Configuration example:
assignment:
on-player-attack-entity:
type: EVENT
event: "org.bukkit.event.entity.EntityDamageByEntityEvent" # Fully qualified class name.
event-player: "getDamager" # This calls our scoreboard when the 'damager' is our player.
stay-seconds: 6 # The scoreboard will stay on the screen for 6 seconds.
Examples of events:
Player joining the server: org.bukkit.event.player.PlayerJoinEvent
method: getPlayer
Player attacking another entity: org.bukkit.event.entity.EntityDamageByEntityEvent
method: getDamager
Player being attacked by another entity: org.bukkit.event.entity.EntityDamageByEntityEvent
method: getEntity
More Bukkit events: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/package-summary.html
Event placeholders KiteBoard 3 allows you to retrieve information from an event using placeholders. This allows you to display almost every detail about an event to the player.
Usage: {event.method.method.method}
Example:
- Getting the name of an entity or player that your fighting:
{event.getEntity.getName}
How to find methods You can easily lookup all available methods using JavaDocs. Example for when a player get's attacked: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/entity/EntityDamageByEntityEvent.html This page shows all available methods, we can integrate these into placeholders to display values:
Get the attackers name: {event.getDamager.getName}
Get the amount of damage: {event.getFinalDamage}
KiteBoard © Niall7459 2015 - 2020 | Contributors: Andre601