Interface ModifiableWorld
- All Known Subinterfaces:
class_5423
,ModifiableTestableWorld
,ServerWorldAccess
,StructureWorldAccess
,WorldAccess
- All Known Implementing Classes:
ChunkRegion
,ClientWorld
,ServerWorld
,World
public interface ModifiableWorld
- Mappings:
Namespace Name official bud
intermediary net/minecraft/class_1945
named net/minecraft/world/ModifiableWorld
-
Method Summary
Modifier and Type Method 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)
-
Method Details
-
setBlockState
Updates the block state at a position, calling appropriate callbacks.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:
- 0b0000001 // 1 - PROPAGATE_CHANGE - Propagates a change event to surrounding blocks.
- 0b0000010 // 2 - NOTIFY_LISTENERS - Notifies listeners and clients who need to react when the block changes
- 0b0000100 // 4 - NO_REDRAW - Used in conjunction with NOTIFY_LISTENERS to suppress the render pass on clients.
- 0b0001000 // 8 - REDRAW_ON_MAIN_THREAD - Forces a synchronous redraw on clients.
- 0b0010000 // 16 - FORCE_STATE - Bypass virtual block state changes and forces the passed state to be stored as-is.
- 0b0100000 // 32 - SKIP_DROPS - Prevents the previous block (container) from dropping items when destroyed.
- 0b1000000 // 64 - MOVED - Signals that the current block is being moved to a different location, usually because of a piston.
- Parameters:
pos
- the target positionstate
- the block state to setflags
- the bitwise flag combination, as described abovemaxUpdateDepth
- the limit for the cascading block updates- Mappings:
Namespace Name Mixin selector official a
Lbud;a(Lfx;Lcht;II)Z
intermediary method_30092
Lnet/minecraft/class_1945;method_30092(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;II)Z
named setBlockState
Lnet/minecraft/world/ModifiableWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z
-
setBlockState
Updates the block state at a position, calling appropriate callbacks.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:
- 0b0000001 // 1 - PROPAGATE_CHANGE - Propagates a change event to surrounding blocks.
- 0b0000010 // 2 - NOTIFY_LISTENERS - Notifies listeners and clients who need to react when the block changes
- 0b0000100 // 4 - NO_REDRAW - Used in conjunction with NOTIFY_LISTENERS to suppress the render pass on clients.
- 0b0001000 // 8 - REDRAW_ON_MAIN_THREAD - Forces a synchronous redraw on clients.
- 0b0010000 // 16 - FORCE_STATE - Bypass virtual block state changes and forces the passed state to be stored as-is.
- 0b0100000 // 32 - SKIP_DROPS - Prevents the previous block (container) from dropping items when destroyed.
- 0b1000000 // 64 - MOVED - Signals that the current block is being moved to a different location, usually because of a piston.
- Parameters:
pos
- the target positionstate
- the block state to setflags
- the bitwise flag combination, as described above- Mappings:
Namespace Name Mixin selector official a
Lbud;a(Lfx;Lcht;I)Z
intermediary method_8652
Lnet/minecraft/class_1945;method_8652(Lnet/minecraft/class_2338;Lnet/minecraft/class_2680;I)Z
named setBlockState
Lnet/minecraft/world/ModifiableWorld;setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;I)Z
-
removeBlock
- Mappings:
Namespace Name Mixin selector official a
Lbud;a(Lfx;Z)Z
intermediary method_8650
Lnet/minecraft/class_1945;method_8650(Lnet/minecraft/class_2338;Z)Z
named removeBlock
Lnet/minecraft/world/ModifiableWorld;removeBlock(Lnet/minecraft/util/math/BlockPos;Z)Z
-
breakBlock
- Mappings:
Namespace Name Mixin selector official b
Lbud;b(Lfx;Z)Z
intermediary method_22352
Lnet/minecraft/class_1945;method_22352(Lnet/minecraft/class_2338;Z)Z
named breakBlock
Lnet/minecraft/world/ModifiableWorld;breakBlock(Lnet/minecraft/util/math/BlockPos;Z)Z
-
breakBlock
- Mappings:
Namespace Name Mixin selector official a
Lbud;a(Lfx;ZLaqv;)Z
intermediary method_8651
Lnet/minecraft/class_1945;method_8651(Lnet/minecraft/class_2338;ZLnet/minecraft/class_1297;)Z
named breakBlock
Lnet/minecraft/world/ModifiableWorld;breakBlock(Lnet/minecraft/util/math/BlockPos;ZLnet/minecraft/entity/Entity;)Z
-
breakBlock
boolean breakBlock(BlockPos pos, boolean drop, @Nullable Entity breakingEntity, int maxUpdateDepth)- Mappings:
Namespace Name Mixin selector official a
Lbud;a(Lfx;ZLaqv;I)Z
intermediary method_30093
Lnet/minecraft/class_1945;method_30093(Lnet/minecraft/class_2338;ZLnet/minecraft/class_1297;I)Z
named breakBlock
Lnet/minecraft/world/ModifiableWorld;breakBlock(Lnet/minecraft/util/math/BlockPos;ZLnet/minecraft/entity/Entity;I)Z
-
spawnEntity
- Mappings:
Namespace Name Mixin selector official b
Lbud;b(Laqv;)Z
intermediary method_8649
Lnet/minecraft/class_1945;method_8649(Lnet/minecraft/class_1297;)Z
named spawnEntity
Lnet/minecraft/world/ModifiableWorld;spawnEntity(Lnet/minecraft/entity/Entity;)Z
-