程序包 org.bukkit.event

接口 Cancellable

所有已知实现类:
AsyncPlayerChatEvent, BlockBreakEvent, BlockBurnEvent, BlockDamageEvent, BlockDispenseEvent, BlockExplodeEvent, BlockFadeEvent, BlockFormEvent, BlockFromToEvent, BlockGrowEvent, BlockIgniteEvent, BlockMultiPlaceEvent, BlockPhysicsEvent, BlockPistonEvent, BlockPistonExtendEvent, BlockPistonRetractEvent, BlockPlaceEvent, BlockSpreadEvent, BrewEvent, BrewingStandFuelEvent, BroadcastMessageEvent, CauldronLevelChangeEvent, ChunkUnloadEvent, CraftItemEvent, CreatureSpawnEvent, CreeperPowerEvent, EnchantItemEvent, EnderDragonChangePhaseEvent, EntityAirChangeEvent, EntityBlockFormEvent, EntityBreakDoorEvent, EntityBreedEvent, EntityChangeBlockEvent, EntityCombustByBlockEvent, EntityCombustByEntityEvent, EntityCombustEvent, EntityCreatePortalEvent, EntityDamageByBlockEvent, EntityDamageByEntityEvent, EntityDamageEvent, EntityExplodeEvent, EntityInteractEvent, EntityPickupItemEvent, EntityPortalEvent, EntityPortalExitEvent, EntityRegainHealthEvent, EntityResurrectEvent, EntityShootBowEvent, EntityTameEvent, EntityTargetEvent, EntityTargetLivingEntityEvent, EntityTeleportEvent, EntityToggleGlideEvent, ExplosionPrimeEvent, FireworkExplodeEvent, FoodLevelChangeEvent, FurnaceBurnEvent, FurnaceSmeltEvent, HangingBreakByEntityEvent, HangingBreakEvent, HangingPlaceEvent, HorseJumpEvent, InventoryClickEvent, InventoryCreativeEvent, InventoryDragEvent, InventoryInteractEvent, InventoryMoveItemEvent, InventoryOpenEvent, InventoryPickupItemEvent, ItemDespawnEvent, ItemMergeEvent, ItemSpawnEvent, LeavesDecayEvent, LightningStrikeEvent, LingeringPotionSplashEvent, NotePlayEvent, PigZapEvent, PlayerAchievementAwardedEvent, PlayerAnimationEvent, PlayerArmorStandManipulateEvent, PlayerBedEnterEvent, PlayerBucketEmptyEvent, PlayerBucketEvent, PlayerBucketFillEvent, PlayerChatEvent, PlayerCommandPreprocessEvent, PlayerDropItemEvent, PlayerEditBookEvent, PlayerFishEvent, PlayerGameModeChangeEvent, PlayerInteractAtEntityEvent, PlayerInteractEntityEvent, PlayerInteractEvent, PlayerItemConsumeEvent, PlayerItemHeldEvent, PlayerItemMendEvent, PlayerKickEvent, PlayerLeashEntityEvent, PlayerMoveEvent, PlayerPickupArrowEvent, PlayerPickupItemEvent, PlayerPortalEvent, PlayerShearEntityEvent, PlayerStatisticIncrementEvent, PlayerSwapHandItemsEvent, PlayerTeleportEvent, PlayerToggleFlightEvent, PlayerToggleSneakEvent, PlayerToggleSprintEvent, PlayerUnleashEntityEvent, PlayerVelocityEvent, PortalCreateEvent, PotionSplashEvent, PrepareItemEnchantEvent, ProjectileLaunchEvent, RemoteServerCommandEvent, ServerCommandEvent, SheepDyeWoolEvent, SheepRegrowWoolEvent, SignChangeEvent, SlimeSplitEvent, StructureGrowEvent, TabCompleteEvent, ThunderChangeEvent, VehicleCreateEvent, VehicleDamageEvent, VehicleDestroyEvent, VehicleEnterEvent, VehicleEntityCollisionEvent, VehicleExitEvent, VillagerAcquireTradeEvent, VillagerReplenishTradeEvent, WeatherChangeEvent, WorldUnloadEvent

public interface Cancellable
  • 方法概要

    修饰符和类型
    方法
    说明
    boolean
    获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。
    void
    setCancelled(boolean cancel)
    取消这个事件.
  • 方法详细资料

    • isCancelled

      boolean isCancelled()
      获取这个事件是否被取消.一个被取消的事件不会在服务器里被执行,但是仍然会传递事件到其他插件。

      原文:Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

      返回:
      如果事件已经被取消,则为true
    • setCancelled

      void setCancelled(boolean cancel)
      取消这个事件. 一个被取消的事件不会在 服务器里被执行,但是仍然会传递事件到其他插件。

      原文:Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

      参数:
      cancel - 如果你想取消这个事件,则为true