0% found this document useful (0 votes)
103 views

14eredit Basic Documentation

The document provides documentation on the operators, functions, and commands for the 14erEdit in-game editor. It includes a table of contents, tables of operators and their arguments, examples of operations, and a reference of commands organized in a tree structure. Italicized features indicate those coming in future releases, while depreciated features are being removed in the next major update.

Uploaded by

Chesse God
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

14eredit Basic Documentation

The document provides documentation on the operators, functions, and commands for the 14erEdit in-game editor. It includes a table of contents, tables of operators and their arguments, examples of operations, and a reference of commands organized in a tree structure. Italicized features indicate those coming in future releases, while depreciated features are being removed in the next major update.

Uploaded by

Chesse God
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

1

14erEdit
Documentation
To Use This Documentation:
Command reference is at the bottom
Tables of functions, operations, IDs, variables, etc. are at the top

Italics indicate features coming in the next release. Depreciated features are being
removed as part of the upcoming v2.0.0 update.

Get 14erEdit

Table of Contents

Table of Contents

Operators

Sample operations

Macros

Special block names

Commands Reference Tree

14erEdit Functions Syntax


Special Symbols
Interpreter Commands
2

Operators
The new way to make modifications to the world!
Written in prefix notation; nesting is allowed. Valid operators here:
Any of the symbols are valid in the 1.15+ versions of 14erEdit. Only the first symbol is
valid in other versions.
You can use () and [] to help organize operators. They will be stripped from the operator
before it gets parsed.
Symbol Args #1 #2 #3

~ not 1 Inverts this

! physics ignore_physics 1 Effect

@ adj adjacent 2 Range Block


blocks_adjacent

@v adjv adjacent_vertical 2 Range Block

@h adjh 2 Range Block


adjacent_horizontal

@@ near nearby 3 Block Distance Range for true


Range for Block Distance
true

# simplex 3 Dimensions Cutoff (from Scale factor


0 to 255)

## noise 4+ type dimensions cutoff frequency [other ...]

A whole lotta noise functions, all in one operator.


NoiseType is the type of noise to generate (case insensitive). Options are: Value
ValueFractal Perlin PerlinFractal Simplex SimplexFractal Cellular WhiteNoise
WhiteNoiseInt Cubic CubicFractal
Dimensions is how many dimensions to use. Both 2 and 3 are supported by all noise,
with 4 supported by Simplex, WhiteNoise, WhiteNoiseInt
Cutoff is a value in [0,255] for where to toggle between true and false for the output of
the operator
Frequency changes the blob size / noise coarseness. Around 4 is usually good.
Other includes more settings for fractal and cellular noise. Please note fractal settings
come first and all settings are in the order listed.
Fractal settings (think noise-based world generation):
3

octaves - How many layers of noise to use? 3 is usually good.


lacunarity - The frequency multiplier between each layer of noise. 2 is usually good.
gain - The strength of each noise layer compared to the last. 0.5 is usually good.
type - The type of fractal, a number from 0, 1 or 2. 0 is usually good.
Cellular settings:
distance - the formula used to compute distances. One of (case insensitive): Euclid
Manhattan Natural

#a noiseat 4 noiseNode midplane amplitude function

This applies noise to the world to create hills and such.


noiseNode is any noise node (##) - note the cutoff will be ignored
midplane is the midplane of the noise function. Negative values take the value of the
current block.
amplitude is the distance from a midplane to either the maximum or minimum possible
block to be edited
function is the function to run at each position

m# multinoise 3+ Regions Noise node Nodes to run


(min 2) on each region

The cutoff value in the noise node is ignored. You must provide the correct number of
nodes equal to the number of regions.
Example usage of multinoise:
/fx br s 12 if bedrock m# 3 ## perlin 3 120 3 set white_concrete set orange_concrete
set magenta_concrete

template tpl 2+ Template file Arg count [args ...]

fx 2+ Function file Arg count [args ...]

smallruin 4 xRange yRange floorRange op

$ macro 1 Macro

% odds chance 1 Odds of true

^ above blocks_above 2 Range Block

& and both 2 First Second

anyof any_of 3+ Count Total Operations ...

Returns true once <count> of the <total> sub-operations return true - executed in order.
Sample: /fx br s 5 if anyof 2 3 orange_concrete white_concrete at 0 1 0 not air set
stone
4

* exposed faces_exposed 1 Num for true

- range 2 Minimum Maximum

_ below blocks_below 2 Range Block

? if 3 Condition If true Else (optional)

A note on conditions. Using a string prefaced with a # will target all blocks whose IDs
contain that string. For example, "#stair" will target all blocks with "stair" in their ID.
The if syntax is similar to: if <condition> <when true> [else <when false>]

: else 1 Else
operation

/* 0 Begin comment

*/ 0 End comment

Comments are able to be nested.

sky skylight 1 Sky light level for true

bl blocklight 1 Block light level for true

< xor 2 First Second

> >> set set_block 1 Block

When combining multiple blocks together, please connect each block with ; rather than
, otherwise it might not work.
e.g. 25%dirt;75%stone
In the block node, you can use the keyword "same" to indicate that the block should not
be changed, e.g. 50%stone;50%same

>r replace 2 From To

Replace a block with another block, supporting multiple blocks separated by a | symbol.
Supports all functions of a normal block node for each element.
Sample: /fx br s 5 replace gold_block|cobweb diamond_block|gravel

%- randrange 2 Minimum Maximum

#- randnoise 3 Minimum Maximum Noise node

Both %- and #- can be placed anywhere a number node is used

<< data get_data 0


5

get_block_data

schem schematic 0+ Condition on


schematic
block

Takes 0 arguments in a set, 1 node argument otherwise.

Sample usage (with offset):


/fx br v at 0 3 0 br schem cube if schem not white_concrete set schem

| or either 2 First Second

false 0

true 0

ang angle 2 Range Distance

biome set_biome 1 Biome (all


caps)

biome_is get_biome 1 Biomes, csv


is_biome

; rem remainder 2 X/Y/Z Base

mod 4 <x|y|z> <base> <low> <high>

Returns true when the block's coordinate on the given axis mod base is in [low,high)

limit 2 x|y|z Value

Returns true when the block's coordinate on the given axis is in (-inf,value]

;; every step 2 X/Y/Z Base

$$ script craftscript 1 Script

at block_at 4 xyz Block

To use absolute coordinates, preface the value with the letter "a".
Ex: at 0 a255 0

br brush 3+ Brush shape Brush args Operation

grav gravity 0
6

>>n set_nbt 1 NBT tag

<<n get_nbt 0

-con 2 String or String


<<n

>f file 1 filepath


(reads from
plugins/14er
Edit/ops/<fil
epath>)

loop while 1 Condition Operation

/ link 2 Op 1 Op 2

-eq 2 Var Value

-lt 2 Var Value

-gt 2 Var Value

-lte 2 Var Value

-gte 2 Var Value

x 0

y 0

z 0

dealloc deallocate 2 Variable Variable


type name

save 3 Variable Variable Path


type name

load 3 Variable Variable Path


type name

num number 1 Variable


name

blk block 1 Variable


name
7

>b set_block_variable 1 Block


variable

itm item 1 Variable


name

>i get_item 1 Item


variable

mob monster 1 Variable


name

>m spawn_monster 1 Variable


name

>im monster_item 1 Variable


get_monster_item name

spwn spawner_var 1 Variable


name

>s set_spawner 1 Variable


name

>is spawner_item 1 Variable


get_spawner_item name

var modify_variable 3 Variable Variable Mod as csv


type name

>>i item_command 2 Variable File path


get_item_command name

>>m monster_command 2 Variable File path


get_montser_command name

>>s spawner_command 2 Variable File path


get_spawner_command name

Valid modifications for numerics

set 1 Value

+ 0

inc 1 Value

mult 1 Value
8

pow 1 Value

exp 1 Value

trn 0

Valid modifications for blocks

type 1 Type

data 1 Data

nbt 1 NBT

Valid modifications for items

color 2+ text color true/false for


any of bold,
(this element can go into the italics,
place of any plain text underlined,
elements) strikethrough,
obfuscated (in
order)

type 1 Text ID

name 1 Text.
Underscore
= space

lore 1 Text,
Underscore
= space,

ench 2 Enchant Level


name

attr 4 Attribute Operation, Value


name then slot
(with a
comma
between)

cnt 1 Value

flag 1 Value
9

unbreak 1 true/false

dmg 1 Value

Valid modifications for monsters

type 1 Type

name 1 Text
(supports
color)

base 2 Tag name Value

attr 2 Attribute Value


name

eff 3 Effect ID Level Duration (game


(numeric) ticks)

gear 2 Slot Item variable


name

drop 2 Slot Chance (1 =


100%)

pass 1 Monster
variable
name

tag 1 Tag

Valid modifications for spawners

cnt (spawn count) 1 Value

rng (spawn range) 1 Value

del (initial delay) 1 Value

mindel (minimum delay) 1 Value

maxdel (maximum delay) 1 Value

maxnear (max nearby 1 Value


entities)

plrrng (player range) 1 Value


10

mob (add a mob) 2 Mob Weight

Sample operations
These make for a great starting point, and are easily
editable. As written, they will turn the item in your main
hand into a sphere brush that does as listed.

To use as a selection, replace /fx br s # with /fx sel op

/fx br v macro erode{7;melt;cut}


/fx br v macro erode{7;melt;raise}
/fx br v macro erode{7;melt;smooth}
Three samples of the erode macro, all radius 7; set to
cut away, expand out, and smooth(ish) respectively (probably
don't run these on a multi-block selection)

/fx br s 5 if sponge set dirt


Replace sponge with dirt, radius 5

/fx br s 5 set sandstone


Set to sandstone, radius 5

/fx br s 5 if odds 50 set stone else set dirt


/fx br s 5 set 50%stone;50%dirt
Set to half stone, half dirt, radius 5

/fx br s 5 if sponge if odds 60 set grass_block else if odds


50 set stone else set gravel
/fx br s 5 if sponge set 60%grass_block;20%stone;20%gravel
Replace sponge with 60% grass, 20% stone,gravel
(remaining 40% is split 50/50), radius 5
11

/fx br s 5 if either dirt sandstone set air


/fx br s 5 if dirt,sandstone set air
Replace dirt and sandstone with air, radius 5

/fx br s 5 if sandstone set air else set stone


Replace sandstone with air, and everything else with
stone, radius 5

/fx br s 5 if not air if sandstone set stone else set gravel


/fx br s 5 if sandstone set stone else if not air set gravel
Replace sandstone with stone, and everything else that
isn't air with gravel, radius 5

/fx br s 5 if not air set sandstone


Replace everything that is not air with sandstone,
radius 5

/run / itm sword / var itm sword type,iron_sword / var itm


sword name,&2Sword / var itm sword lore,Made_in_14erEdit >i
sword
Sample custom item (unless you are learning the NBT
editor, you can probably ignore this)

More sample commands can be found in Eris’ document here.


12

Other Useful Commands

/fx undo 1
/un
Undo the last edit

/fx redo 1
/re
Redo the last thing you undid

/fx wand
Gives you a selection wand

/fx br none
Remove the brush from the current item

There is more content past this point / on the next pages,


by the way.
13

Macros
These are special functions that can be called as part of an operation, often to perform
even more complex functions. They are passed parameters, each in a pair of {}
appended (without spaces) to the name of the macro. Parameters are separated by
semicolons.
Note that using a macro with a brush of more than one block is undefined, and may
cause unintended behaviors. To get a one block brush, use radius 0 and radius
correction 0.5.
Macro Arguments Description

erode {radius;mode;modeArg} An erosion brush.


Radius is the radius to erode
Modes:
melt - A melt style erosion
cut - Erode away more
raise - Add blocks mode
smooth - Neutral smoothing
lift - Aggressive raise
carve - Aggressive cut
mix - A mixture of melt types
add - More additive
subtract - More subtractive
blend - More neutral
blend - Blend blocks together.
modeArg is the chance out of
100 to blend a block, and is
followed by a bool for if air
should be processed
blockblend - Scramble the
non-air block's types. Does not
take a modeArg

adverode {radius;solidCut;airCut} Advanced erosion. Radius is


the radius to erode. solidCut is
nearby solid to make solid.
airCut is nearby air to make air.
14

tree {type;leaves;trunk;size;variance} A basic tree generator. Will only


replace air, but can be placed
on any block. Note that this
does not use the Minecraft tree
algorithms, nor does it attempt
to imitate them. Experiment to
see what the different types
look like.
Types of tree:
oak, branch, big, bush, birch,
darkoak, redmushroom,
brownmushroom, jungle

Leaves and trunk must be a


single block, used to fill in the
tree.
Size and variance determine
how large of a tree to generate

schem {path;xOff;yOff;zOff;setAir;mirrorString Paste the schematic at path


} with the offset of (xOff, yOff,
zOff) from the bottom center of
the schematic. It can be set to
paste air as air or to keep the
already existing block.
mirrorString contains [x|y|z|r]+;
and is optional. r will randomize
x and z mirroring
Can use | symbol in the path to
choose one schematic from a
list at random
Providing an [x|y|z]Off that is
not a valid integer will result in
the schematic automatically
15

centering along that axis

grass {radius;mixture;airSpaces;density} Creates a grass-placing brush


of the specified radius, with the
given generator values.

vines {radius;length;variance;density;block} Creates a vine placing brush.


Block can be omitted, defaults
to vines.

biome {radius;biome} Creates a biome changing


brush

flatten {radius;absolute;height;block} Creates a brush that flattens


stuff to the given height.
Absolute accepts a boolean,
and if true, will flatten columns
of world, and if false, will flatten
only the contents of the brush.
Sets to either air or block (no
block states allowed) based on
height, within a radius of the
center.

line {block;blockCount;startDist} Brush-bindable line. It will place


blockCount instances of block
spaced equally between a point
startDist in front of the player to
the block hit by the brush
(meaning the first block in the
player's line of sight not present
in the brush mask).
16

Special block names


These are keywords you can use in place of a block name to perform special actions or
selections. Their scope is sometimes limited depending on if the command makes
sense in a given context.
Regular blocks are defined using their in-game IDs and support BlockData in the form of
[] tags.
Name Meaning Scope

same The block currently in the Blocks


position.

facing <block> Add a random facing Blocks with facing data


direction from
[up,down,north,east,south,
west] to the block's data
17

Commands Reference Tree


❏ fx
❏ brush Optional brush args are beta only.
If the parser misguesses the end of the brush arguments, insert an "end"
to force it to stop parsing brush arguments
❏ sphere|s <radius> [correction] <op> - Create a new sphere brush
using the currently held item. The correction can change how
spherical the sphere is. Larger numbers are more square, and 0.5
is a good starting place.
❏ radiussphere <radius> <op> - Create a new radius sphere brush
using the currently held item
❏ square|cube <side> <op> - Create a new square brush using the
currently held item
❏ diamond|d <halfDiag> <op> - Create a new diamond brush using
the currently held item
❏ hollowsphere|hsphere|hs <radius> <thickness> [correction] <op> -
Create a new hollow sphere brush using the currently held item
❏ ellipse|e <rx> <ry> <rz> [correction] <op> - Create a new ellipsoid
brush, with the specified semi-axis. A good starting value for
correction is 0.15.
❏ randomsphere|rs <min radius> <max radius> [correction] <op> - A
sphere brush of varying size
❏ voxel|v <op> - Single block brush
❏ scaledsphere|ss <radius> <correction> <xScale> <yScale>
<zScale> <op> - Create a sphere where each axis' square distance
is multiplied by the scale in the radius calculation
❏ oldcylinder|oldc <radius> <correction> <axis=x|y|z> <op> - A
cylinder brush.
To set the height, use the scaledsphere brush, with a scale set to 0,
the radius set to the height, and the other two scales set to the
radio of the height to the desired radius
❏ splatter|splat|blob|b <radius> <sphere count> <sphere radius>
[correction] <op> - Splatter/blob brush. Places sphere count
spheres of radius sphere radius and correction correction within a
radius of radius of the brush center
❏ randomsplatter|rsplat|randomblob|rb <radius min> <radius max>
<sphere count min> <sphere count max> <sphere radius min>
18

<sphere radius max> [correction] <op> - Randomized splatter


brush
❏ randomellipse|re <x min> <x max> <y min> <y max> <z min> <z
max> [correction] <op> - Randomized ellipse brush
❏ randomoldcylinder|roldc <radius min> <radius max> <correction>
<axis=x|y|z> <op> - Randomized radius cylinder brush
❏ randomhollowsphere|randomhsphere|rhs <radius min> <radius
max> <center radius min> <center radius max> [correction] <op> -
Randomized hollow sphere brush
❏ randomcube|randomsquare|rcube|rsquare <side min> <side max>
<op> - Randomized cube brush
❏ randomdiamond|rd <radius min> <radius max> <op> - Randomized
diamond brush
❏ column|col - Column brush (bottom to top)
❏ above|up - Column brush above this block
❏ below|down - Column brush below this block
❏ multi <file> [args...] - Multi-brush brush
Loads a set of brushes from the file "14erEdit/multibrushes/<file>".
Replaces template parameters as defined in templates. Operates
on the world using the brushes defined in the file top to bottom, in
order.
Sample file, named twospheres.txt:
s 5 0.5 set $1
s 9 0.5 if not $1 set $2
Sample usage: /fx br multi twospheres stone glass
Note that multi MUST be the top level brush and cannot be nested.
❏ schem|schematic <name> <op> - Create a new schematic brush
using the file specified. The center of the schematic and center of
the brush will overlap when used. Enables usage of the schem
operator.
❏ cylinder|cyl <radius> <halfHeight> <axis=x|y|z> [correction] <op> -
Create a cylinder brush
❏ rotatedellipse|rote <half inter-focii distance> <"string length"> [xDir
yDir zDir = random] <op> - Create an ellipse that has an arbitrary
rotation. Rotation is random if not provided, and if provided points
from the brush center to a focal point.
Half inner-focii distance is half the distance between the focal point
of the ellipse.
"String length" determines the size of the ellipse. Larger numbers
19

are a bigger ellipse. This must be more than double the inner-focii
distance. The larger the ratio of this to the full focal length, to more
spherical the ellipse.
❏ spike|sp <height> <base radius> [inner base size] <op> - Create a
spike/crystal brush. Spikes go both directions from the click point,
and grow both directly toward and away from the player. Setting an
inner radius will make a hollow spike.
❏ flood|fill|floodfill <max distance> <condition op> <op> - Perform a
floodfill with a maximum distance from the start of max distance
(using the shortest path of connected blocks), performing op on any
blocks that meet the condition op that are connected to the starting
block (which must also satisfy the condition op)
❏ none - Remove the brush from the currently held item
❏ br - Alias for brush
❏ wand - Give this player a wand. Right/left click to create a selection
❏ selection
❏ op <operation> - Perform the specified operation on the current
selection
❏ expand <amt> <direction> - Expand the current selection
❏ reset - Remove the selection
❏ copy - Copy the current selection to the clipboard, including NBT
❏ paste - Paste the current clipboard
❏ paste <setAir> - Paste the current clipboard, relative to the position
you had when copying. Can set to place air or not using true/false.
❏ origin <shift/set> <x/y/z> <value> - Shifts or sets the origin of the
current clipboard by the given amount along the given axis
❏ schem - Alias for schematic
❏ pos1 [x y z] - Set the first position of the selection box to the player
❏ pos2 [x y z] - Set the second position of the selection box to the
player
❏ mirror <x|y|z> - Set the mirror axes for the current clipboard (eg
mirror xy). Does not update the origin when mirroring.
❏ rotate <value> - Sets the rotation of the schematic. Takes a value
between 0 and 5 specifying the rotation.
❏ clone <xOffset> <yOffset> <zOffset> <times> <deleteOriginal> -
Clone a selection region (much like move or stack in WorldEdit).
Specify a relative offset, a number of times to clone, and if the
original blocks should be deleted or not.
❏ sel - Alias for selection
20

❏ schem - Root command for schematics. Schematics support arbitrary size


and are fully async-linked. This is completely separate from the clipboard.
❏ save <file> - Saves the current selection box to a file. Uses the
Schemlite format (other formats not supported as of this time).
❏ load <file> [<mirrorArgs> <pasteAir> <rotation>] - Loads the
selection from a file and pastes it into the world, with the player in
the most negative corner. Mirror args and paste air are the same as
for pasting a clipboard. Loads using the Schemlite format.
❏ list [regex] - List all schematics that can be loaded, matching an
optional regex
❏ delete <schematic> - Delete a schematic
❏ reset - Reset the player's state. Includes brushes and selections.
❏ script
❏ erode <radius> <mode> - Create a brush preset for erosion. Modes are
cut, raise, carve, lift, smooth.
❏ tree <type> <size> [leaves] [wood] - Tree brush that allows setting the
leaves and wood to different blocks. Leaves default to lime wool, wood to
brown wool. They can be set together or not at all, but cannot be set with
block states. Valid tree types are the same as the tree macro.
❏ vines <radius> <length> <variance> [density] [block] - Creates a brush for
placing vines
❏ biome <biome> <radius> - Create a biome changing brush. This script
cannot be undone (though it will register an undo), so please be careful.
You may need to log off and back onto the server to see the change.
Affects a 4x4x4 area (1.15-1.16) or an entire column of blocks (1.14 and
lower). If this does not work, try the biome operator.
❏ flatten <height> <block> [radius] - Flatten the world to the height (only
things within the brush/selection, though). Works as a brush if radius is
set, otherwise works on the selection. Only edits blocks within the
brush/selection.
❏ absflatten <height> <block> [radius] - Fill everything at or below height
with block, and everything above with air. Operates as a brush if radius is
set, otherwise operates on the selection. Operates on the full vertical pillar.
❏ grassbrush <radius> [mixture] [airSpaces] [density] - Like grass except in
brush form. The default mixture is short grass, poppies, and dandelions.
Please note that this can place blocks on top of invalid blocks, just not air.
❏ grass [mixture] [airSpaces] [density] - Plants grass on top of any blocks
with at least airSpaces of air above them. Defaults to short & tall grass
21

with flowers, and an airSpaces value of 5 with density 0.5 (half of the
blocks). Mixture is specified like the blocks in set script.
❏ overlay <radius> <block> <depth> [air] - Create an overlay brush. Defaults
to 3 blocks of air above
❏ line <block> <length> - Draw a line from the player's position in the
direction clicked, going out length blocks. Length is not exact number of
blocks, but is close.
❏ catenary <block> <droop> [step] - Create a catenary between the two
corners of the selection brush. If there are gaps, shrink the step count
from 0.01 to something smaller (but larger than zero). Droop is a magic
value, but around -35 seems to be good
❏ clone <xMin> <xMax> <yMin> <yMax> <zMin> <zMax> <xOff> <yOff>
<zOff> - Clone a box's materials (no NBT) to a location with a given offset.
Does not register an undo.
❏ operate <xMin> <xMax> <yMin> <yMax> <zMin> <zMax>- Run an
operation on an entire selection. Does not register an undo.
❏ cat - Alias for catenary
❏ cs - Alias for script
❏ un [number] - Undo a number of world edits, defaults to one
❏ re [number] - Redo a number of world edits, defaults to one
❏ run <operation> - Execute an operation without a defined region. Any world
editing operations will be centered on the player's location without the ability to
undo
❏ runat <x> <y> <z> <brush> <operation> - Simulate a brush stroke at the given
coordinates, without registering an undo.
❏ debug - Toggle the debug messages in chat
❏ error - Toggle verbose error messages
❏ confirm [number=1 | auto] - Confirm large async edits that cannot be undone
❏ cancel [number=1] - Cancel large async edits that cannot be undone
❏ async - Commands for working with the async system
❏ drop - Drop the async queue, stopping all edits in place and forcing them
to be restarted
❏ status - Query the async queue. Gets the number of remaining blocks to
process, as well as the estimated completion time.
❏ dump - Dump some more detailed stats about the async queue to the
chat.
❏ queue - Alias for status
❏ brmask <blocks, space separated> - Changes the blocks that a brush can pass
through. Default is air. Ex: /brmask air water lava
22

❏ template <template> [args...] - Load a command from a template, substitute


arguments, then execute. Templates are located in "14erEdit/templates". Note
newlines are removed from template files when loaded. 14erEdit will try to load
an exact filename, as well as with a ".txt" extension. Template parameters to
replace are a dollar sign followed by a number.
Sample template: "fx br s $1 0.5 set $2" in file "14erEdit/templates/sphere.txt"
Sample usage: "/template sphere 7 air"
❏ tmp - Alias for template
❏ funct <file name> [args] - Run a 14erEdit function. Functions are saved in
"14erEdit/functions", and are written using 14erEdit Functions Syntax (see below)
❏ limit <nx|ny|nz|px|py|pz> <value> - Change the global block edit bounding box of
14erEdit. Set <value> to “max” for maximum dimension and “min” for minimum
dimension.
23

14erEdit Functions Syntax


Functions in 14erEdit are a way to automate tasks that are extremely unwieldy to create
using other systems. At a high level, they function quite similarly to Minecraft's normal
functions, however a full assembly-style programming language is also built into
14erEdit functions. They are written in 14erEdit Functions Definition Language (14FDL).

Each line in 14erEdit functions falls into one of five categories, each with a different
purpose:
1. Lines that are blank or only contain whitespace
a. These lines may be used for helping format the file. They will not be run.
2. Lines that start with any amount of whitespace followed by a #
a. These lines are considered comments. Anything on these lines will be
ignored
3. Lines that start with any amount of whitespace followed by a !
a. These lines are considered commands to be executed by the function file
interpreter. The formatting of these lines is as follows:
!<command> [args...]
Between the ! and the command should be no space, between the
command and args a single space, and between each arg a single space.
4. Lines that start with any amount of whitespace followed by a :
a. These lines are considered to be labels, usable in certain interpreter
commands. They will not be run.
5. Lines that have any amount of whitespace followed by other text
a. These lines will be executed by the player who ran the function as a
command. Any commands that the player would normally be able to type
in-game are valid for usage.

Special Symbols
● Template variables: $1 $2 $3 ...
There are an unlimited number of template variables. They will be replaced with
each input the player gives in the command when calling the function, split on
each space. These are substituted as the first step when running a line in the
function, before making any determination as to what should happen for this line.
● Variables: $v0 $v1 $v2 ... $v999
These are each a numeric variable comparable to a double in a standard
24

programming language. They may be modified by interpreter commands, and in


some cases will be replaced with their contained value (such as in output). They
will be substituted into normal commands to be run before execution, as well. At
the start of the function, they all have the value 0.
● Global variables: $gv0 $gv1 $gv2 ... $gv99
Special variables that are saved between functions and function calls and only
get reset when the server gets rebooted. They are otherwise equivalent to
normal variables.
● Special variables:
$ra
If a jump interpreter command is executed with the "store return" flag set to true,
this variable will contain the location that was jumped from, such that jumping to
this variable will execute the command following the jump. Defaults to end of
function.
$cmpres
Stores the output of the most recently run comparison. Defaults to true. False is
defined as any value within 0.01 of 0.

Interpreter Commands
● Player Interaction
○ setslot <slot> <item ID>
■ Set the item in the slot to the item ID. Can use an int, or hand.
○ swap <slot 1> <slot 2>
■ Swaps the contents of the two slots. Must use an int.
○ getpos <var> <dim>
■ Gets the user's coordinate for the given dimension, storing it into
var
If in an operation, returns the current block's location.
dim: x=0, y=1, z=2
○ prtdbg <text>
■ Print text to the debug output stream
○ prterr <text>
■ Print text to the error output stream
○ gettarget <var> <dim>
■ Get what the player is looking at, storing it into var.
dim: x=0, y=1, z=2
● World Interaction
25

○ blk <ID> <x> <y> <z>


■ If block at x y z matches ID, store true into $cmpres (this is a
comparison). Else store false.
Supports multiple blocks as a semicolon-delimited list.
Supports IDs prefixed with # to check if the ID contains the string
● Logic and Control Flow
○ cmpvar <var1> <var2>
■ Compare two variables. Returns true if they are equal, false else
○ cmptext <text 1> <text 2>
■ Compare two strings. Returns true if they are equal, ignoring case,
false else.
○ cmpslot <slot> <item ID>
■ Check the contents of the user's inventory slot. Returns true if it has
the given ID, false else. Slots defined same as set command.
Supports multiple blocks as a semicolon-delimited list.
Supports IDs prefixed with # to check if the ID contains the string
○ goif <label> [store return = true]
■ Goes to the label if the most recent comparison was true. Can store
the return location or not.
○ goifnot <label> [store return = true]
■ Goes to the label if the most recent comparison was false. Can
store the return location or not.
○ return
■ Return to the location of the $ra variable
○ exit [return val = true | variable]
■ End execution of this function now, with an optional boolean or
variable (double/number node) return value
○ wait
■ Wait until the async queue is empty to continue running
Does not work if in an operation
○ waittime <var>
■ Wait a number of ticks before continuing
Does not work if in an operation
● Variable storage
○ store <variable>
■ Store the value of the variable to the top of the stack
○ get <variable> [offset = 0]
26

■ Get the value from the stack, with an optional offset, and set a
variable to the value.
Invalid stack locations will return 0.
○ remove
■ Remove the topmost variable from the stack
○ getval <variable> <arg>
■ Pull a numerical value from a user argument into a variable. The
arg is an index (no $), whereas the variable is the full variable
name. Sample: !getval $v0 0
○ defaultarg <pos> <arg>
■ Sets the default value for a template arg if one was not provided.
Make sure they are set in increasing order of pos.
● Math
○ setvar <variable> [value = 0]
■ Set the variable to the value
○ rand <variable> <min> <max>
■ Set the variable to a random integer in the range [min,max)
min and max can both either be integers or variables
○ inc <variable>
■ Increase variable by 1
○ dec <variable>
■ Decrease variable by 1
○ add <var1> <var2> <dest>
■ Add the two variables and store the result in the dest variable
○ sub <var1> <var2> <dest>
■ Subtract the two variables and store the result in the dest variable
○ mult <var1> <var2> <dest>
■ Multiply the two variables and store the result in the dest variable
○ mod <var1> <var2> <dest>
■ Treat both variables like integers, and computer var1 % var2;
storing the result into the dest variable
○ div <var1> <var2> <dest>
■ Divide the two variables and store the result in the dest variable
○ sin <variable> <dest>
■ Take the sine of the variable and store the result in the dest
variable. Takes degrees
○ cos <variable> <dest>
■ Take the cosine of the variable and store the result in the dest
variable. Takes degrees
27

○ pow <var1> <var2> <dest>


■ Compute var1^var2 and store the result in the dest variable
○ single <function> <var> <dest>
■ Execute a single-variable math function and store the result in dest
○ double <function> <var1> <var2> <dest>
■ Execute a two-variable math function and store the result in dest
○ ceil <variable>
■ Rounds the variable in question upwards so that 1.1 rounds to 2.0
○ floor <variable>
■ Rounds the variable in question downwards so that 1.8 rounds to
1.0
○ round <variable>
■ Rounds a variable mathematically so that 1.5 rounds to 2.0
○ log <value> <base>
■ Computes a log base of the value
○ asin<value>
■ Computes asin of the value
○ acos<value>
■ Computes acos of the value
○ sinh<value>
■ Computes sinh of the value
○ cosh <value>
■ Computes cosh of the value

You might also like