Class Event

java.lang.Object
cn.nukkit.event.Event
Direct Known Subclasses:
BlockEvent, BlockStateRepairEvent, CraftItemEvent, CreatureSpawnEvent, EntityEvent, InventoryEvent, InventoryTransactionEvent, LevelEvent, PlayerCreationEvent, PlayerEvent, PluginEvent, PotionEvent, ScoreboardEvent, ServerEvent, VehicleEvent, WeatherEvent

public abstract class Event extends Object
描述服务器中可能发生的事情的类。
Describes things that happens in the server.

服务器中可能发生的事情称作事件。定义一个需要它在一个事件发生时被运行的过程,这个过程称作监听器
Things that happens in the server is called a event. Define a procedure that should be executed when a event happens, this procedure is called a listener.

Nukkit调用事件的处理器时,会通过参数的类型判断需要被监听的事件。
When Nukkit is calling a handler, the event needed to listen is judged by the type of the parameter.

关于监听器的实现,参阅:Listener
For the way to implement a listener, see: Listener

Since:
Nukkit 1.0 | Nukkit API 1.0.0
Author:
Unknown(code) @ Nukkit Project, 粉鞋大妈(javadoc) @ Nukkit Project
See Also:
  • Field Details

    • eventName

      protected String eventName
  • Constructor Details

    • Event

      public Event()
  • Method Details

    • getEventName

      public final String getEventName()
    • isCancelled

      public boolean isCancelled()
    • setCancelled

      public void setCancelled()
    • setCancelled

      public void setCancelled(boolean value)