public interface ModifiableWorld
Modifier and Type | Method and Description |
---|---|
default boolean |
breakBlock(BlockPos pos,
boolean drop) |
default boolean |
breakBlock(BlockPos pos,
boolean drop,
Entity breakingEntity) |
boolean |
breakBlock(BlockPos pos,
boolean drop,
Entity breakingEntity,
int maxUpdateDepth) |
boolean |
removeBlock(BlockPos pos,
boolean move) |
default boolean |
setBlockState(BlockPos pos,
BlockState state,
int flags)
Updates the block state at a position, calling appropriate callbacks.
|
boolean |
setBlockState(BlockPos pos,
BlockState state,
int flags,
int maxUpdateDepth)
Updates the block state at a position, calling appropriate callbacks.
|
default boolean |
spawnEntity(Entity entity) |
boolean setBlockState(BlockPos pos, BlockState state, int flags, int maxUpdateDepth)
When called on the server, the new block state is stored and propagated to clients and listeners as dictated by the supplied flags. Note that calling this on the client will update the world locally, but may not see the change persisted across loads. It's recommended to check whether this world is client before interacting with the world in this way.
Accepted values of the flags are a bitset combination of the following:
pos
- the target positionstate
- the block state to setflags
- the bitwise flag combination, as described abovemaxUpdateDepth
- the limit for the cascading block updatesdefault boolean setBlockState(BlockPos pos, BlockState state, int flags)
When called on the server, the new block state is stored and propagated to clients and listeners as dictated by the supplied flags. Note that calling this on the client will update the world locally, but may not see the change persisted across loads. It's recommended to check whether this world is client before interacting with the world in this way.
Accepted values of the flags are a bitset combination of the following:
pos
- the target positionstate
- the block state to setflags
- the bitwise flag combination, as described aboveboolean removeBlock(BlockPos pos, boolean move)
default boolean breakBlock(BlockPos pos, boolean drop)
boolean breakBlock(BlockPos pos, boolean drop, @Nullable Entity breakingEntity, int maxUpdateDepth)
default boolean spawnEntity(Entity entity)