public class EventFactory extends Object
Modifier and Type | Method and Description |
---|---|
<T extends org.bukkit.event.Event> |
callEvent(T event)
Calls an event through the plugin manager.
|
static EventFactory |
getInstance()
The instance of this class.
|
<T extends org.bukkit.event.entity.EntityDamageEvent> |
onEntityDamage(T event)
Runs an EntityDamageEvent and updates
Entity.setLastDamageCause(org.bukkit.event.entity.EntityDamageEvent) and
(for a LivingEntity only) LivingEntity.setLastDamage(double) . |
org.bukkit.event.player.AsyncPlayerChatEvent |
onPlayerChat(boolean async,
org.bukkit.entity.Player player,
String message)
Handles an incoming chat message.
|
org.bukkit.event.player.PlayerInteractEvent |
onPlayerInteract(org.bukkit.entity.Player player,
org.bukkit.event.block.Action action,
org.bukkit.inventory.EquipmentSlot hand)
Handles a click in the air.
|
org.bukkit.event.player.PlayerInteractEvent |
onPlayerInteract(org.bukkit.entity.Player player,
org.bukkit.event.block.Action action,
org.bukkit.inventory.EquipmentSlot hand,
org.bukkit.block.Block clicked,
org.bukkit.block.BlockFace face)
Handles a click on a block.
|
org.bukkit.event.player.PlayerJoinEvent |
onPlayerJoin(org.bukkit.entity.Player player) |
org.bukkit.event.player.PlayerKickEvent |
onPlayerKick(org.bukkit.entity.Player player,
String reason) |
org.bukkit.event.player.PlayerLoginEvent |
onPlayerLogin(GlowPlayer player,
String hostname)
Handles post-hooks for a player login, including the name and IP banlists, whitelist policy
and occupancy limit.
|
org.bukkit.event.player.AsyncPlayerPreLoginEvent |
onPlayerPreLogin(String name,
InetSocketAddress address,
UUID uuid)
Handles pre-hooks for a player login.
|
org.bukkit.event.player.PlayerQuitEvent |
onPlayerQuit(org.bukkit.entity.Player player) |
static void |
setInstance(EventFactory instance)
The instance of this class.
|
public <T extends org.bukkit.event.Event> T callEvent(T event)
T
- The type of the event.event
- The event to throw.public org.bukkit.event.player.AsyncPlayerPreLoginEvent onPlayerPreLogin(String name, InetSocketAddress address, UUID uuid)
name
- the name of the player who is logging inaddress
- the address of the player who is logging inuuid
- the UUID of the player who is logging in, provided by Mojangpublic org.bukkit.event.player.PlayerLoginEvent onPlayerLogin(GlowPlayer player, String hostname)
player
- the loginhostname
- the hostname that was used to connect to the serverpublic org.bukkit.event.player.AsyncPlayerChatEvent onPlayerChat(boolean async, org.bukkit.entity.Player player, String message)
async
- This changes the event to a synchronous state.player
- the sending playermessage
- the messagepublic org.bukkit.event.player.PlayerJoinEvent onPlayerJoin(org.bukkit.entity.Player player)
public org.bukkit.event.player.PlayerKickEvent onPlayerKick(org.bukkit.entity.Player player, String reason)
public org.bukkit.event.player.PlayerQuitEvent onPlayerQuit(org.bukkit.entity.Player player)
public org.bukkit.event.player.PlayerInteractEvent onPlayerInteract(org.bukkit.entity.Player player, org.bukkit.event.block.Action action, org.bukkit.inventory.EquipmentSlot hand)
player
- the playeraction
- the click actionhand
- the active handpublic org.bukkit.event.player.PlayerInteractEvent onPlayerInteract(org.bukkit.entity.Player player, org.bukkit.event.block.Action action, org.bukkit.inventory.EquipmentSlot hand, org.bukkit.block.Block clicked, org.bukkit.block.BlockFace face)
player
- the playeraction
- the click actionhand
- the active handclicked
- the block clickedface
- the side of the block clickedpublic <T extends org.bukkit.event.entity.EntityDamageEvent> T onEntityDamage(T event)
Entity.setLastDamageCause(org.bukkit.event.entity.EntityDamageEvent)
and
(for a LivingEntity
only) LivingEntity.setLastDamage(double)
.T
- the event's typeevent
- the event to runpublic static EventFactory getInstance()
public static void setInstance(EventFactory instance)
Copyright © 2021. All rights reserved.