Skip to content

Setfield

Hariiiiiiii edited this page Feb 2, 2021 · 2 revisions

Sets the value of a specific field in the current tag.

Setting Fields In Tags

The setfield command can set fields by specifying the field name and the value you want to give it.

Usage

SetField <field name> <field value>

  • field name - the name of the field you would like to edit.
  • field value - the value you want to give the field.

Setting Fields In Tag blocks

The setfield command can set fields in tag blocks by specifying the block name and index before the field name and value, you can set fields multiple blocks deep by specifying all the block names and indexes until you reach the field you want to set.

Usage

setfield <block name>[block index].<field name> <field value>

  • block name - the name of the block you would like to edit.
  • block index - the index of the block you would like to edit.
  • field name - the name of the field you would like to edit.
  • field value - the value you want to give the field.

Field Types

There are many different field types each with their own way of setting them.

Flags

Flag fields containain multiple flags that can be turned on and off, multiple flags can be turned on at the same time by separating the flag name with comma's.

Usage

setfield <field name> <flag1>,<flag2>,<flag3>

  • field name - the name of the field you would like to edit.
  • flagX - the name of the flag you want to check.

Ranges

Range fields have lower and upper bounds

Usage

setfield <field name> <lower> <upper>

  • field name - the name of the field you would like to edit.
  • lower - the lower bounds of the range.
  • upper - the upper bounds of the range.

Real Point 3D

Real point 3D fields use x y z coordinates.

Usage

setfield <field name> <x> <y> <z>

  • field name - the name of the field you would like to edit.
  • x - the value of the x axis.
  • y - the value of the y axis.
  • z - the value of the z axis.

String Id's

String Id's fields use the value of a string id.

Usage

setfield <field name> <string id>

  • field name - the name of the field you would like to edit.
  • string id - the name of an existing string id, if the string id doesn't exist, you will need to create it with the stringid command.

Tag References

Tag reference fields reference other tags in the cache.

Usage

setfield <field name> <tag name>

  • field name - the name of the field you would like to edit.
  • tag name - the name of the tag you would like to reference.
Clone this wiki locally