public class BlockCanBuildEvent extends BlockEvent
Note:
getMaterial()
instead.
Event.Result
Modifier and Type | Field | Description |
---|---|---|
protected BlockData |
blockData |
|
protected boolean |
buildable |
block
Constructor | Description |
---|---|
BlockCanBuildEvent(@NotNull Block block,
@NotNull BlockData type,
boolean canBuild) |
Deprecated.
|
BlockCanBuildEvent(@NotNull Block block,
@Nullable Player player,
@NotNull BlockData type,
boolean canBuild) |
Modifier and Type | Method | Description |
---|---|---|
@NotNull BlockData |
getBlockData() |
Gets the BlockData that we are trying to place.
|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@NotNull Material |
getMaterial() |
Gets the Material that we are trying to place.
|
@Nullable Player |
getPlayer() |
Gets the player who placed the block involved in this event.
|
boolean |
isBuildable() |
Gets whether or not the block can be built here.
|
void |
setBuildable(boolean cancel) |
Sets whether the block can be built here or not.
|
getBlock
getEventName, isAsynchronous
protected boolean buildable
protected BlockData blockData
@Deprecated public BlockCanBuildEvent(@NotNull @NotNull Block block, @NotNull @NotNull BlockData type, boolean canBuild)
public BlockCanBuildEvent(@NotNull @NotNull Block block, @Nullable @Nullable Player player, @NotNull @NotNull BlockData type, boolean canBuild)
block
- the block involved in this eventplayer
- the player placing the blocktype
- the id of the block to placecanBuild
- whether we can buildpublic boolean isBuildable()
By default, returns Minecraft's answer on whether the block can be built here or not.
public void setBuildable(boolean cancel)
cancel
- true if you want to allow the block to be built here
despite Minecraft's default behaviour@NotNull public @NotNull Material getMaterial()
@NotNull public @NotNull BlockData getBlockData()
@Nullable public @Nullable Player getPlayer()
@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2020. All rights reserved.