Skip to content

SteppedOnBlock 5.47.0 ​

interface · pocketmine\block\utils\SteppedOnBlock · source

A block which acts on the entities standing on it (vanilla Block.stepOn()), like magma blocks hurting them, slime slowing them down or turtle eggs being trampled.

Every tick, an entity on the ground looks up the block under its feet (the one at 0.2 blocks below its position), and calls SteppedOnBlock::onEntityStepOn() if that block implements this interface. Which block states implement it is cached by state ID, so the other blocks cost nothing.

Methods ​

onEntityStepOn() ​

php
public function onEntityStepOn(\pocketmine\entity\Entity $entity) : void

Called every tick while the entity stands on this block (players included, also when they don't move).

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.