set block||doc135395

September 20, 2022

Format

 Map:posConvertBlock(pos, fullName) 
  • The class to which the function belongs:Map

Description

Sets the block at the specified coordinates in the map to the specified block.


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 coordinate
fullName string block configuration name


Value Returned

type Description
boolean set result


Code Samples

on the server sideglobal script, change the block at coordinates (0, 1, 0) to a grass block

local map = World.CurWorld:getMap("map001")
local ret = map:posConvertBlock({x = 0, y = 1, z = 0}, "myplugin/grass")