接口的使用
org.bukkit.block.Block
程序包
说明
Bukkit API的顶级程序包, 包含通用的API类和接口.
用于操作在
世界
内的三位像素(方块),包括一些特定的状态.各种方块的 BlockData 类.
与处理玩家输入的非聊天消息(即命令)相关的类.
为在
世界
内存在的非三维像素单位(实体)提供的接口,包含玩家、怪物、抛射物等.参与操作玩家物品栏和物品交互的类.
代表一个抛射物的抛射源的类的集合.
提供多种目的和单一目的的类以简化各种编程概念.
-
org.bukkit中Block的使用
修饰符和类型方法说明Chunk.getBlock
(int x, int y, int z) 从区块中获取某个方块(Block
).Location.getBlock()
获取本位置对应的方块.Vibration.Destination.BlockDestination.getBlock()
World.getBlockAt
(int x, int y, int z) 获取坐标所指的方块
.World.getBlockAt
(@NotNull Location location) World.getHighestBlockAt
(int x, int z) 获取指定坐标最高处不是空气且不可逾越的方块.World.getHighestBlockAt
(int x, int z, @NotNull HeightMap heightMap) Gets the highest block corresponding to theHeightMap
at the given coordinates.World.getHighestBlockAt
(@NotNull Location location) 获取指定位置
最高处不是空气且不可逾越的方块.World.getHighestBlockAt
(@NotNull Location location, @NotNull HeightMap heightMap) Gets the highest block corresponding to theHeightMap
at the given coordinates. -
org.bukkit.block中Block的使用
修饰符和类型方法说明BlockState.getBlock()
获取此方块状态所表示的方块.Block.getRelative
(int modX, int modY, int modZ) 以此方块为基点, 在指定的偏移量上获取方块.Block.getRelative
(@NotNull BlockFace face) 获取这个方块某一面上紧邻的方块.Block.getRelative
(@NotNull BlockFace face, int distance) 获取这个方块某一面上指定距离的方块.修饰符和类型方法说明Conduit.getFrameBlocks()
Get aCollection
of allBlocks
that make up the frame of this conduit. -
org.bukkit.block.data中Block的使用
-
org.bukkit.command中Block的使用
-
org.bukkit.entity中Block的使用
修饰符和类型方法说明AbstractArrow.getAttachedBlock()
获得这支箭连接的方块.Raider.getPatrolTarget()
获取袭击者要巡逻的目标方块.LivingEntity.getTargetBlock
(@Nullable Set<Material> transparent, int maxDistance) 获取生物实体的目标方块.LivingEntity.getTargetBlockExact
(int maxDistance) 获取该生物实体瞄准的方块。LivingEntity.getTargetBlockExact
(int maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) 获取该生物实体瞄准的方块。修饰符和类型方法说明LivingEntity.getLastTwoTargetBlocks
(@Nullable Set<Material> transparent, int maxDistance) 获取沿生物实体视线上最后两个方块.LivingEntity.getLineOfSight
(@Nullable Set<Material> transparent, int maxDistance) 获取沿生物实体视线上的所有方块.修饰符和类型方法说明boolean
Player.breakBlock
(@NotNull Block block) Force this player to break a Block using the item in their main hand.void
Raider.setPatrolTarget
(@Nullable Block block) 设置袭击者要巡逻的目标方块. -
org.bukkit.event.block中Block的使用
修饰符和类型字段说明protected Block
BlockEvent.block
protected Block
BlockPlaceEvent.placedAgainst
protected Block
BlockFromToEvent.to
修饰符和类型方法说明BlockEvent.getBlock()
获取这个事件涉及的方块.BlockPlaceEvent.getBlockAgainst()
获取这个方块是依附在哪个方块上放置的.BlockPlaceEvent.getBlockPlaced()
获得被放置的方块(还未真正被放置).BlockBurnEvent.getIgnitingBlock()
获取点燃这个方块的方块.BlockIgniteEvent.getIgnitingBlock()
获取点燃方块的方块.TNTPrimeEvent.getPrimingBlock()
Get the block that caused the TNT to be primed.BlockSpreadEvent.getSource()
获取这个事件中蔓延的源方块.BlockPhysicsEvent.getSourceBlock()
获取触发本事件的源方块.BlockFromToEvent.getToBlock()
获取方块要移动到的地方的一个快捷的方法.修饰符和类型方法说明BlockExplodeEvent.blockList()
返回被炸毁的方块的列表.BlockPistonExtendEvent.getBlocks()
获取被活塞移动的不可改变的方块列表.BlockPistonRetractEvent.getBlocks()
获取被活塞移动的不可改变的方块列表.限定符构造器说明BellResonateEvent
(@NotNull Block theBlock, @NotNull List<LivingEntity> resonatedEntities) BlockBreakEvent
(@NotNull Block theBlock, @NotNull Player player) BlockBurnEvent
(@NotNull Block block) 已过时。BlockBurnEvent
(@NotNull Block block, @Nullable Block ignitingBlock) BlockCanBuildEvent
(@NotNull Block block, @NotNull BlockData type, boolean canBuild) 已过时。BlockCanBuildEvent
(@NotNull Block block, @Nullable Player player, @NotNull BlockData type, boolean canBuild) BlockDamageEvent
(@NotNull Player player, @NotNull Block block, @NotNull ItemStack itemInHand, boolean instaBreak) BlockDispenseArmorEvent
(@NotNull Block block, @NotNull ItemStack dispensed, @NotNull LivingEntity target) BlockDropItemEvent
(@NotNull Block block, @NotNull BlockState blockState, @NotNull Player player, @NotNull List<Item> items) BlockEvent
(@NotNull Block theBlock) BlockExpEvent
(@NotNull Block block, int exp) BlockExplodeEvent
(@NotNull Block what, @NotNull BlockState blockState, @NotNull List<Block> blocks, float yield, @NotNull ExplosionResult result) BlockFadeEvent
(@NotNull Block block, @NotNull BlockState newState) BlockFertilizeEvent
(@NotNull Block theBlock, @Nullable Player player, @NotNull List<BlockState> blocks) BlockFormEvent
(@NotNull Block block, @NotNull BlockState newState) BlockFromToEvent
(@NotNull Block block, @NotNull Block toBlock) BlockFromToEvent
(@NotNull Block block, @NotNull BlockFace face) BlockGrowEvent
(@NotNull Block block, @NotNull BlockState newState) BlockIgniteEvent
(@NotNull Block theBlock, @NotNull BlockIgniteEvent.IgniteCause cause, @NotNull Block ignitingBlock) BlockIgniteEvent
(@NotNull Block theBlock, @NotNull BlockIgniteEvent.IgniteCause cause, @Nullable Entity ignitingEntity) BlockIgniteEvent
(@NotNull Block theBlock, @NotNull BlockIgniteEvent.IgniteCause cause, @Nullable Entity ignitingEntity, @Nullable Block ignitingBlock) BlockMultiPlaceEvent
(@NotNull List<BlockState> states, @NotNull Block clicked, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) BlockPhysicsEvent
(@NotNull Block block, @NotNull BlockData changed) BlockPistonEvent
(@NotNull Block block, @NotNull BlockFace direction) BlockPistonExtendEvent
(@NotNull Block block, int length, @NotNull BlockFace direction) 已过时。BlockPistonExtendEvent
(@NotNull Block block, @NotNull List<Block> blocks, @NotNull BlockFace direction) BlockPistonRetractEvent
(@NotNull Block block, @NotNull List<Block> blocks, @NotNull BlockFace direction) BlockPlaceEvent
(@NotNull Block placedBlock, @NotNull BlockState replacedBlockState, @NotNull Block placedAgainst, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild) 已过时。BlockPlaceEvent
(@NotNull Block placedBlock, @NotNull BlockState replacedBlockState, @NotNull Block placedAgainst, @NotNull ItemStack itemInHand, @NotNull Player thePlayer, boolean canBuild, @NotNull EquipmentSlot hand) BlockRedstoneEvent
(@NotNull Block block, int oldCurrent, int newCurrent) BlockSpreadEvent
(@NotNull Block block, @NotNull Block source, @NotNull BlockState newState) BrewingStartEvent
(@NotNull Block furnace, @NotNull ItemStack source, int brewingTime) CampfireStartEvent
(@NotNull Block furnace, @NotNull ItemStack source, @NotNull CampfireRecipe recipe) CauldronLevelChangeEvent
(@NotNull Block block, @Nullable Entity entity, @NotNull CauldronLevelChangeEvent.ChangeReason reason, @NotNull BlockState newBlock) EntityBlockFormEvent
(@NotNull Entity entity, @NotNull Block block, @NotNull BlockState blockstate) FluidLevelChangeEvent
(@NotNull Block theBlock, @NotNull BlockData newData) InventoryBlockStartEvent
(@NotNull Block block, @NotNull ItemStack source) LeavesDecayEvent
(@NotNull Block block) MoistureChangeEvent
(@NotNull Block block, @NotNull BlockState newState) NotePlayEvent
(@NotNull Block block, @NotNull Instrument instrument, @NotNull Note note) SculkBloomEvent
(@NotNull Block theBlock, int charge) 已过时。SignChangeEvent
(@NotNull Block theBlock, @NotNull Player thePlayer, @NotNull String[] theLines, @NotNull Side side) SpongeAbsorbEvent
(@NotNull Block block, @NotNull List<BlockState> waterblocks) TNTPrimeEvent
(@NotNull Block block, @NotNull TNTPrimeEvent.PrimeCause igniteCause, @Nullable Entity primingEntity, @Nullable Block primingBlock) 限定符构造器说明BlockExplodeEvent
(@NotNull Block what, @NotNull BlockState blockState, @NotNull List<Block> blocks, float yield, @NotNull ExplosionResult result) BlockPistonExtendEvent
(@NotNull Block block, @NotNull List<Block> blocks, @NotNull BlockFace direction) BlockPistonRetractEvent
(@NotNull Block block, @NotNull List<Block> blocks, @NotNull BlockFace direction) -
org.bukkit.event.enchantment中Block的使用
修饰符和类型方法说明EnchantItemEvent.getEnchantBlock()
获取附魔这个物品的方块。PrepareItemEnchantEvent.getEnchantBlock()
获取附魔台方块.限定符构造器说明EnchantItemEvent
(@NotNull Player enchanter, @NotNull InventoryView view, @NotNull Block table, @NotNull ItemStack item, int level, @NotNull Map<Enchantment, Integer> enchants, @NotNull Enchantment enchantmentHint, int levelHint, int i) PrepareItemEnchantEvent
(@NotNull Player enchanter, @NotNull InventoryView view, @NotNull Block table, @NotNull ItemStack item, @NotNull EnchantmentOffer[] offers, int bonus) -
org.bukkit.event.entity中Block的使用
修饰符和类型方法说明EntityChangeBlockEvent.getBlock()
返回改变之前的方块(Block)类 原文: Gets the block the entity is changingEntityEnterBlockEvent.getBlock()
获取实体将进入的方块.EntityInteractEvent.getBlock()
返回实体交互的方块EntityPlaceEvent.getBlock()
返回实体被放置在的方块.EntityCombustByBlockEvent.getCombuster()
造成燃烧的可以是岩浆或者一个着火的方块.EntityDamageByBlockEvent.getDamager()
返回使玩家受到伤害的方块.ProjectileHitEvent.getHitBlock()
Gets the block that was hit, if it was a block that was hit.限定符构造器说明EntityBreakDoorEvent
(@NotNull LivingEntity entity, @NotNull Block targetBlock) EntityCombustByBlockEvent
(@Nullable Block combuster, @NotNull Entity combustee, float duration) EntityCombustByBlockEvent
(@Nullable Block combuster, @NotNull Entity combustee, int duration) 已过时。EntityDamageByBlockEvent
(@Nullable Block damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, double damage) 已过时, 待删除: 此 API 元素将从以后的版本中删除。EntityDamageByBlockEvent
(@Nullable Block damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull Map<EntityDamageEvent.DamageModifier, Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) 已过时, 待删除: 此 API 元素将从以后的版本中删除。EntityDamageByBlockEvent
(@Nullable Block damager, @Nullable BlockState damagerState, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, double damage) EntityDamageByBlockEvent
(@Nullable Block damager, @Nullable BlockState damagerState, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull DamageSource damageSource, @NotNull Map<EntityDamageEvent.DamageModifier, Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) EntityEnterBlockEvent
(@NotNull Entity entity, @NotNull Block block) EntityInteractEvent
(@NotNull Entity entity, @NotNull Block block) EntityPlaceEvent
(@NotNull Entity entity, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace) 已过时。EntityPlaceEvent
(@NotNull Entity entity, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace, @NotNull EquipmentSlot hand) ExpBottleEvent
(@NotNull ThrownExpBottle bottle, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace, int exp) LingeringPotionSplashEvent
(@NotNull ThrownPotion potion, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace, @NotNull AreaEffectCloud entity) PotionSplashEvent
(@NotNull ThrownPotion potion, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace, @NotNull Map<LivingEntity, Double> affectedEntities) ProjectileHitEvent
(@NotNull Projectile projectile, @Nullable Block hitBlock) ProjectileHitEvent
(@NotNull Projectile projectile, @Nullable Entity hitEntity, @Nullable Block hitBlock) ProjectileHitEvent
(@NotNull Projectile projectile, @Nullable Entity hitEntity, @Nullable Block hitBlock, @Nullable BlockFace hitFace) 限定符构造器说明EntityExplodeEvent
(@NotNull Entity what, @NotNull Location location, @NotNull List<Block> blocks, float yield, @NotNull ExplosionResult result) -
org.bukkit.event.hanging中Block的使用
限定符构造器说明HangingPlaceEvent
(@NotNull Hanging hanging, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace, @Nullable EquipmentSlot hand) 已过时。HangingPlaceEvent
(@NotNull Hanging hanging, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace, @Nullable EquipmentSlot hand, @Nullable ItemStack itemStack) -
org.bukkit.event.inventory中Block的使用
修饰符和类型方法说明HopperInventorySearchEvent.getSearchBlock()
Gets the Block that is being searched for an inventory.限定符构造器说明BrewEvent
(@NotNull Block brewer, @NotNull BrewerInventory contents, @NotNull List<ItemStack> results, int fuelLevel) BrewingStandFuelEvent
(@NotNull Block brewingStand, @NotNull ItemStack fuel, int fuelPower) FurnaceBurnEvent
(@NotNull Block furnace, @NotNull ItemStack fuel, int burnTime) FurnaceExtractEvent
(@NotNull Player player, @NotNull Block block, @NotNull Material itemType, int itemAmount, int exp) FurnaceStartSmeltEvent
(@NotNull Block furnace, @NotNull ItemStack source, @NotNull CookingRecipe<?> recipe) HopperInventorySearchEvent
(@NotNull Inventory inventory, @NotNull HopperInventorySearchEvent.ContainerType containerType, @NotNull Block hopper, @NotNull Block searchBlock) -
org.bukkit.event.player中Block的使用
修饰符和类型方法说明PlayerBedEnterEvent.getBed()
返回此事件涉及的床.PlayerBedLeaveEvent.getBed()
返回此事件涉及的床.PlayerBucketEvent.getBlock()
获取本事件所涉及的方块 (岩浆/水方块等).PlayerBucketEvent.getBlockClicked()
玩家正在对着哪个方块使用桶,返回那个方块.PlayerInteractEvent.getClickedBlock()
返回被点击的方块.PlayerHarvestBlockEvent.getHarvestedBlock()
获取被收获的方块。限定符构造器说明PlayerBedEnterEvent
(@NotNull Player who, @NotNull Block bed) 已过时。PlayerBedEnterEvent
(@NotNull Player who, @NotNull Block bed, @NotNull PlayerBedEnterEvent.BedEnterResult bedEnterResult) PlayerBedLeaveEvent
(@NotNull Player who, @NotNull Block bed, boolean setBedSpawn) PlayerBucketEmptyEvent
(@NotNull Player who, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEmptyEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEmptyEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand) PlayerBucketEvent
(@NotNull Player who, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand) PlayerBucketFillEvent
(@NotNull Player who, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketFillEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand) 已过时。PlayerBucketFillEvent
(@NotNull Player who, @NotNull Block block, @NotNull Block blockClicked, @NotNull BlockFace blockFace, @NotNull Material bucket, @NotNull ItemStack itemInHand, @NotNull EquipmentSlot hand) PlayerHarvestBlockEvent
(@NotNull Player player, @NotNull Block harvestedBlock, @NotNull List<ItemStack> itemsHarvested) 已过时。PlayerHarvestBlockEvent
(@NotNull Player player, @NotNull Block harvestedBlock, @NotNull EquipmentSlot hand, @NotNull List<ItemStack> itemsHarvested) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace, @Nullable EquipmentSlot hand) PlayerInteractEvent
(@NotNull Player who, @NotNull Action action, @Nullable ItemStack item, @Nullable Block clickedBlock, @NotNull BlockFace clickedFace, @Nullable EquipmentSlot hand, @Nullable Vector clickedPosition) -
org.bukkit.event.vehicle中Block的使用
-
org.bukkit.inventory中Block的使用
-
org.bukkit.projectiles中Block的使用
-
org.bukkit.util中Block的使用
修饰符和类型方法说明static @NotNull BoundingBox
Creates a new 1x1x1 sized bounding box containing the given block.static @NotNull BoundingBox
Creates a new bounding box using the coordinates of the given blocks as corners.