Standard Library
Code of Copper supports all builtin functions defined in the GolemScript standard library.
It also defines some of its own, which are specific to Code of Copper.
void print ( any value )
Print is defined by the GolemScript standard library, but Code of Copper extends this behaviour by printing all outputs of this function in the chat, to anyone within 16 blocks of the Golem.
void move ( int x, int y, int z )
Moves the golem x
blocks in the x direction, y
blocks in the y direction, and z
blocks in the z direction.
It moves a maximum of one block in each direction per tick.
If the golem cannot move at all, it skips this function.
resource getblock ( int x, int y, int z )
Returns the resource location of the block at x
, y
, z
, relative to the golem.
void place ( resource block, array [int x, int y, int z] )
Places a block
at x
, y
, z
, relative to the golem.
If the golem does not have that block, it does nothing.
If the block at that position is not replaceable, it does nothing.
If block
is a tool, it breaks the block at that position and puts the drop into its inventory.
object { x: int, y: int, z: int } pos ()
Returns the x
, y
and z
coordinates of the golem.
array [ resource ] inventory ()
Returns an array of resources, the namespaced IDs of every item in the golem's inventory.