@minecraft/server / BlockCustomComponent
Interface: BlockCustomComponent ​
Defined in: @minecraft/server/index.d.ts:22447
Contains a set of events that will be raised for a block. This object must be bound using the BlockRegistry.
Properties ​
beforeOnPlayerPlace? ​
optionalbeforeOnPlayerPlace?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22454
Parameters ​
arg0 ​
BlockComponentPlayerPlaceBeforeEvent
arg1 ​
Returns ​
void
Remarks ​
This function will be called before a player places the block.
onBlockStateChange? ​
optionalonBlockStateChange?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22455
Parameters ​
arg0 ​
BlockComponentBlockStateChangeEvent
arg1 ​
Returns ​
void
onBreak? ​
optionalonBreak?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22468
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when a specific block is destroyed. Changes in block permutations will not trigger this event. Fill Command and SetBlock Command can trigger this event when changing a block permutation only when using destroy mode. Custom blocks with the "minecraft:replaceable" component will not trigger the event when replaced.
onEntity? ​
optionalonEntity?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22475
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when an entity fires an event to this block in the world.
onEntityFallOn? ​
optionalonEntityFallOn?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22482
Parameters ​
arg0 ​
BlockComponentEntityFallOnEvent
arg1 ​
Returns ​
void
Remarks ​
This function will be called when an entity falls onto the block that this custom component is bound to.
onPlace? ​
optionalonPlace?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22489
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when the block that this custom component is bound to is placed.
onPlayerBreak? ​
optionalonPlayerBreak?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22490
Parameters ​
arg0 ​
BlockComponentPlayerBreakEvent
arg1 ​
Returns ​
void
onPlayerInteract? ​
optionalonPlayerInteract?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22498
Parameters ​
arg0 ​
BlockComponentPlayerInteractEvent
arg1 ​
Returns ​
void
Remarks ​
This function will be called when a player sucessfully interacts with the block that this custom component is bound to.
onRandomTick? ​
optionalonRandomTick?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22504
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when a block randomly ticks.
onRedstoneUpdate? ​
optionalonRedstoneUpdate?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22513
Parameters ​
arg0 ​
BlockComponentRedstoneUpdateEvent
arg1 ​
Returns ​
void
Remarks ​
This function will be called when an 'onRedstoneUpdate' engine event occurs if the block has a minecraft:redstone_consumer component and the redstone signal strength is >= to the components min_power field.
onStepOff? ​
optionalonStepOff?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22520
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when an entity steps off the block that this custom component is bound to.
onStepOn? ​
optionalonStepOn?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22527
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when an entity steps onto the block that this custom component is bound to.
onTick? ​
optionalonTick?: (arg0,arg1) =>void
Defined in: @minecraft/server/index.d.ts:22533
Parameters ​
arg0 ​
arg1 ​
Returns ​
void
Remarks ​
This function will be called when a block ticks.