remove block||doc135406

September 20, 2022

Format

 Map:removeBlock(pos) 
  • The class to which the function belongs:Map

Description

Remove the block at the specified coordinates and triggerBLOCK_REMOVERemoved block event.


Precautions

  • The values of each axis of the pos coordinate must be integers, otherwise there will be unintended consequences.

Parameters

Variable name type Description
pos Vector3 specified location


Value Returned

type Description
boolean remove block result


Code Samples

on the server sideglobal script, remove the block at (1, 1, 1) coordinates

local map = World.CurWorld:getMap("map001")
map:removeBlock({ x = 1, y = 1, z = 1 })