Skip to main content

Block Action

Registration

// kubejs/startup_scripts/actions.js
OriginsJS.registerBlockAction("set_air", (world, pos, direction, params) => {
world.setBlock(pos, Blocks.AIR.defaultBlockState(), 3);
});

JSON

{
"type": "origins:action_on_block_use",
"block_action": {
"type": "origins_js:js_block_action",
"id": "set_air"
},
"block_condition": {
"type": "origins:block",
"block": "minecraft:dirt"
}
}

Callback Parameters

ParamTypeDescription
worldLevelThe dimension / world
posBlockPosPosition of the block
directionDirection?Facing direction, or null
paramsJsonObjectJSON params from the data file