SquidUtils scripting

SquidUtils will read and load all files ending with ".script" in "config/SquidUtils" as script files on startup. The commands in this script can be used to trigger certain reactions if an event occurs, or to fine-tweak certain aspects of the game.

General Syntax
Each command spans one line, the commands are terminated by a newline. The command and its arguments are generally separated by blank spaces. Refer to below for the synax on specific commands.

Lines starting with '#' are ignored as comments.

on
With this command you can trigger certain actions to happen if a certain condition is met.

Syntax: on [trigger] [event arguments] action=[action] [action arguments]

The following triggers are available:
 * entityjoin
 * hurt
 * smelt
 * craft
 * toss
 * heal
 * teleport
 * starve
 * achievement
 * hungerregen
 * interaction
 * explosion
 * command
 * chat

The event arguments and the action arguments are space-separated lists of key-value pairs. The following event arguments are available:
 * minamount=[amount]
 * maxamount=[amount]
 * minhealth=[value]
 * maxhealth=[value]
 * minarmor=[value]
 * maxarmor=[value]
 * minchance=[value] - The numerator of the chance
 * maxchance=[value] - The denominator of the chance
 * item=[item name]
 * entitytype=[entity type name]
 * chattrigger=[string]
 * commandname=[name]
 * hasperm=[permission]
 * missingperm=[permission]

The following actions with their respective arguments are available:
 * explode size=[value]
 * damage damageamount=[amount]
 * applyeffect effect=[potion ID]:[duration]:[level]
 * addexperience experience=[amount]
 * cancel
 * sprint
 * setinvisible
 * difficulty difficulty=[value]
 * cleareffects
 * placeblock blocktoplace=[block name]
 * burn duration=[duration]
 * sethunger foodlevel=[value]

Other mods can add custom triggers, arguments and actions using SquidUtils' API.

Example: This will, with a chance of 3/4, light an entity on fire for 2 seconds whenever they're healed between more than 5 HP: on heal minchance=3 maxchance=4 minamount=5 action=burn fireduration=40

block
This command allows modification of existing blocks' properties as well as creation of new blocks. If StarStones is installed, meteor blocks can also be created.

Syntax: block modify property=(hardness|slipperiness|resistance|texture) value=[value] block modify property=drops action=[remove] item=[modid:itemname] block modify property=drops action=[add] item=[modid:itemname] minchance=[integer] maxchance=[integer] minamount=[integer] maxamount=[integer] block create type=(basic|glass) name=[name] block create type=meteor name=[name] meteortype=(STONE|END|ICE|OBSIDIAN|HELL)

Textures can be provided by a resource pack, they have to be placed in "assets/SquidUtils/textures/blocks".

item
This command allows changing stack sizes and durabilities of items. Also, custom foods and items can be created.

Syntax: item modify item=[modid:itemname] property=(stacksize|maxdamage) value=[integer] item modify item=[modid:itemname] property=[tab] value=[tabname] item create type=[food] name=[name] bars=[integer] saturation=[integer] wolfs=[boolean] item create type=[food] name=[name] bars=[integer] saturation=[integer] wolfs=[boolean] potionid=[integer] duration=[integer] amplifier=[integer] chance=[decimal]

The last 5 parameters are optional. They allow making the food edible even when you're full, and allow it to inflict potion effects upon eating.

Textures can be provided by a resource pack, they have to be placed in "assets/SquidUtils/textures/items".

command
With this command you can disable chat commands or create new simple ones.

Syntax: command disable name=[name] command create type=[info] name=[name] description=[description] text=[text] command create type=[web] name=[name] description=[description] url=[URL] command create type=[basic] name=[name] description=[description] requiresop=(true|false) Description, text and URL must not contain spaces. Instead, '_' will be substituted for a blank space.

"info" will display the specified text.

"web" will download a text file from the URL and display its contents.

"basic" will do nothing, and is intended for use with the "on command" command.

Example: This command will create a "/hello" command that displays "Hello World!" when used. Typing "/help hello" will show "shows a Hello World message". command create info hello shows_a_Hello_World_message Hello_World!

tab
This command can be used to create new creative tabs.

Syntax: tab create [item to use as image] [list of items] The list of items is separated by blank spaces.