Skip to main content

Prevent Block Place (Power Type)

Stops the player from placing blocks.

Type ID: apoli:prevent_block_place

Fields

FieldTypeDefaultDescription
entity_actionEntity Action TypeoptionalIf set, this action runs on the player when they are stopped from placing a block.
held_item_actionItem Action TypeoptionalIf set, this action runs on the item the player tried to place a block with.
place_to_actionBlock Action TypeoptionalIf set, this action runs at the position where the player tried to place the block.
place_on_actionBlock Action TypeoptionalIf set, this action runs on the block the player tried to place the block against.
item_conditionItem Condition TypeoptionalIf set, the actions only run when the item the player used passes this condition.
place_to_conditionBlock Condition TypeoptionalIf set, the actions only run when the block at the target position passes this condition.
place_on_conditionBlock Condition TypeoptionalIf set, the actions only run when the block placed against passes this condition.
directionsArray of Strings["up", "down", "north", "south", "east", "west"]The sides of a block the player has to place against for the actions to run.
handsArray of Hands["main_hand", "off_hand"]The hands the player has to use for the actions to run.
result_stackItem StackoptionalIf set, this item stack is given to the player when they try to place a block.
result_item_actionItem Action TypeoptionalIf set, this action runs on the item given to the player.
note

The power runs before the block is placed, so place_to_condition matches whatever is in that space now, either air or the replaceable block being overwritten, not the block being placed.

Examples

{
	"type": "apoli:prevent_block_place",
	"entity_action": {
		"type": "apoli:execute_command",
		"command": "tellraw @s {\"text\": \"Cannot place a block here!\", \"color\": \"red\"}"
	},
	"place_to_condition": {
		"type": "apoli:fluid",
		"fluid_condition": {
			"type": "apoli:still"
		}
	}
}

This stops the player from placing blocks into spaces filled with a source fluid, such as a water source, and tells them why.