In the method which is executed on the event you want to use: PHP: $position = new Vector3(34, 56, 23); // Some random location$block = $level->getBlock($position);
You need to specify the Level where you want to work: PHP: $level = $this->getServer()->getLevelByName($levelname); You could also get the level by using an entity that it's on it: (Ex. using a player that you already have) PHP: $level = $player->getLevel(); And then, the rest of the code that @Dinokiller give us: Define the position: PHP: $pos = new Vector3($x, $y, $z); This may vary depending on what you want to do: To get a block object: PHP: $level->getBlock($pos); To place a block: (Ex. Using a Bedrock block) PHP: $block = new Bedrock();$level->setBlock($pos, $block); To simulate a "Tap" on a block with a certain item: (Ex. using a Flint & Stell Item) PHP: $item = new FlintandSteel();$level->useItemOn($pos, $item); I hope this will help you P.S: @PEMapModder please correct me if I'm wrong