程序包 org.bukkit.event

接口 Cancellable

所有已知实现类:
AreaEffectCloudApplyEvent, ArrowBodyCountChangeEvent, AsyncPlayerChatEvent, AsyncPlayerChatPreviewEvent, AsyncStructureSpawnEvent, BatToggleSleepEvent, BellRingEvent, BlockBreakEvent, BlockBurnEvent, BlockCookEvent, BlockDamageEvent, BlockDispenseArmorEvent, BlockDispenseEvent, BlockDropItemEvent, BlockExplodeEvent, BlockFadeEvent, BlockFertilizeEvent, BlockFormEvent, BlockFromToEvent, BlockGrowEvent, BlockIgniteEvent, BlockMultiPlaceEvent, BlockPhysicsEvent, BlockPistonEvent, BlockPistonExtendEvent, BlockPistonRetractEvent, BlockPlaceEvent, BlockReceiveGameEvent, BlockShearEntityEvent, BlockSpreadEvent, BrewEvent, BrewingStandFuelEvent, BroadcastMessageEvent, CauldronLevelChangeEvent, CraftItemEvent, CreatureSpawnEvent, CreeperPowerEvent, EnchantItemEvent, EnderDragonChangePhaseEvent, EntityAirChangeEvent, EntityBlockFormEvent, EntityBreakDoorEvent, EntityBreedEvent, EntityChangeBlockEvent, EntityCombustByBlockEvent, EntityCombustByEntityEvent, EntityCombustEvent, EntityCreatePortalEvent, EntityDamageByBlockEvent, EntityDamageByEntityEvent, EntityDamageEvent, EntityDismountEvent, EntityDropItemEvent, EntityEnterBlockEvent, EntityEnterLoveModeEvent, EntityExhaustionEvent, EntityExplodeEvent, EntityInteractEvent, EntityMountEvent, EntityPickupItemEvent, EntityPlaceEvent, EntityPortalEvent, EntityPortalExitEvent, EntityPotionEffectEvent, EntityRegainHealthEvent, EntityResurrectEvent, EntityShootBowEvent, EntitySpawnEvent, EntitySpellCastEvent, EntityTameEvent, EntityTargetEvent, EntityTargetLivingEntityEvent, EntityTeleportEvent, EntityToggleGlideEvent, EntityToggleSwimEvent, EntityTransformEvent, ExpBottleEvent, ExplosionPrimeEvent, FireworkExplodeEvent, FluidLevelChangeEvent, FoodLevelChangeEvent, FurnaceBurnEvent, FurnaceSmeltEvent, GenericGameEvent, HangingBreakByEntityEvent, HangingBreakEvent, HangingPlaceEvent, HorseJumpEvent, InventoryClickEvent, InventoryCreativeEvent, InventoryDragEvent, InventoryInteractEvent, InventoryMoveItemEvent, InventoryOpenEvent, InventoryPickupItemEvent, ItemDespawnEvent, ItemMergeEvent, ItemSpawnEvent, LeavesDecayEvent, LightningStrikeEvent, LingeringPotionSplashEvent, LootGenerateEvent, MoistureChangeEvent, NotePlayEvent, PiglinBarterEvent, PigZapEvent, PigZombieAngerEvent, PlayerAnimationEvent, PlayerArmorStandManipulateEvent, PlayerBedEnterEvent, PlayerBedLeaveEvent, PlayerBucketEmptyEvent, PlayerBucketEntityEvent, PlayerBucketEvent, PlayerBucketFillEvent, PlayerBucketFishEvent, PlayerChatEvent, PlayerCommandPreprocessEvent, PlayerDropItemEvent, PlayerEditBookEvent, PlayerFishEvent, PlayerGameModeChangeEvent, PlayerHarvestBlockEvent, PlayerInteractAtEntityEvent, PlayerInteractEntityEvent, PlayerInteractEvent, PlayerItemConsumeEvent, PlayerItemDamageEvent, PlayerItemHeldEvent, PlayerItemMendEvent, PlayerKickEvent, PlayerLeashEntityEvent, PlayerMoveEvent, PlayerPickupArrowEvent, PlayerPickupItemEvent, PlayerPortalEvent, PlayerRecipeDiscoverEvent, PlayerShearEntityEvent, PlayerSpawnChangeEvent, PlayerStatisticIncrementEvent, PlayerSwapHandItemsEvent, PlayerTakeLecternBookEvent, PlayerTeleportEvent, PlayerToggleFlightEvent, PlayerToggleSneakEvent, PlayerToggleSprintEvent, PlayerUnleashEntityEvent, PlayerVelocityEvent, PortalCreateEvent, PotionSplashEvent, PrepareItemEnchantEvent, ProjectileHitEvent, ProjectileLaunchEvent, RaidTriggerEvent, RemoteServerCommandEvent, ServerCommandEvent, SheepDyeWoolEvent, SheepRegrowWoolEvent, SignChangeEvent, SlimeSplitEvent, SmithItemEvent, SpawnerSpawnEvent, SpongeAbsorbEvent, StriderTemperatureChangeEvent, StructureGrowEvent, TabCompleteEvent, ThunderChangeEvent, TimeSkipEvent, TNTPrimeEvent, TradeSelectEvent, VehicleCreateEvent, VehicleDamageEvent, VehicleDestroyEvent, VehicleEnterEvent, VehicleEntityCollisionEvent, VehicleExitEvent, VillagerAcquireTradeEvent, VillagerCareerChangeEvent, 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