Skip to content

BlockScript

Ferdinand Calo edited this page Jun 4, 2020 · 3 revisions
# Feature Overview
Kind: Block Script
Extendable: true
JSON based: no
JSON config: yes

"BlockScripts" are optional instances of custom "classes" stored in MultiBlocks (See BlockScript.class)

Current methods:

  • read - called when the multiblock's data is read, should read script data
  • write - called when the multiblock's data is written, should return a tag compound
  • onUpdate - called every onUpdate call of the TileEntity (if tickable!)
  • onTrigger - called when a "trigger" (as specified in MultiBlock config)
    is "triggered" by a player when interacting with a block of this multi compound
  • sendPacket - predefined method to send packets to client script instances
  • onUpdatePacket - called client side when a packet is received

When a MultiBlock is marked as "Tickable" you have to option to execute custom
code every tick in your script, and create for example more advanced machines
than (for example) the default pre-shipped scripts offer to make.

Here a list of pre-made scripts:

  • CraftBlockScript - semi-advanced script to setup automatic crafting blocks
    or static crafting blocks (depending on config), can be extended! (see GEP Smeltery)
  • //TODO
Clone this wiki locally