Skip to content
IntegratedQuantum edited this page Mar 4, 2021 · 7 revisions

With Cubyz Addons you can easily add content to the game. Unlike modding, writing an Addon doesn't require any programming experience.

Here you can find an instruction on how to make addon files. At the end of this page you will find a list of links to existing addons.

How to make your own Addon:

  1. Locate the addons folder(should be inside the location you installed Cubyz in)
  2. Create a new folder with the name(should not contain any spaces) of your Addon.
  3. Decide what things you want to add and add the corresponding folder(items, blocks, recipes, biomes, materials).
  4. Create a text file in the folder that represent the item/block/biome/material name(name.any_extension or just name).
    For recipes the file name is not used anywhere in the game and can be used for structuring.
  5. Check the following examples on how to fill the file:

Items

There is not much to do here. All you can do is add a texture path. There will come more possibilities in later versions, if requested.
Put the texture of your item in *cubyz install path*/addons/*addon name*/items/textures.
Copy the texture path(relative to the textures folder) into the file you made for your item:

texture *relative path to texture*/*name of file*.png

If no path or an invalid path is specified the texture will default to no texture.

Example item file(addons/cubyz/items/coal):

texture materials/coal.png

Item IDs are generated as addon_name:item_name. That's also the name that has to be used for recipes and block drops.

Blocks

Each block has the following attributes:

  • a block class which can be one of the following: wood, stone, sand, unbreakable, leaf, fluid and ore.
    The block class determine if the block can be broken and with what tool you can break it.
    Default value: stone
    Syntax example: class stone
  • a hardness which represents the time in seconds needed to break the block by hand. It can get significantly reduced by the right tools.
    Default value: 1
    Syntax example: hardness 1
  • a list of block drops (optionally with amount), which are the items the player will get when they break the block.
    Default value: none
    Syntax example: drop auto(to auto-generate the drop with the same name as the block) or drop 3 addon_name:item_name, 0.5 addon_name2:item_name2, …
  • a 3d model
    Default value: undefined
    Syntax example: model cubyz:block.obj
  • a texture for that 3d model. The texture should be inside addons/*addon name*/blocks/textures.
    Default value: undefined
    Syntax example: texture cubyz:cactus if the texture is in *cubyz install path*/addons/cubyz/blocks/textures/cactus.png
  • wether the block is transparent.
    Default value: no
    Syntax example: transparent yes
  • wether the model of the block is transparent(meaning it is not a cube).
    Default value: no
    Syntax example: viewThrough yes
  • light absorption in case the block is transparent.
    There are four light channels: sun, red, green, blue. The value is given as hexadecimal: 0xssrrggbb
    Default value: 0x00000000
    Syntax example: absorbedLight 0x06080008(The block lets mostly green light through)
  • light emission: how much light the block emits
    There are four light channels: sun, red, green, blue. The value is given as hexadecimal: 0xssrrggbb
    Default value: 0x00000000
    Syntax example: emittedLight 0x00ff8000(The block emits orange light)
  • wether the block is degradable(trees can grow through it).
    Default value: no
    Syntax example: degradable yes
  • wether the block is solid.
    Default value: yes
    Syntax example: solid no
  • a GUI that is opened on left-click. Possible GUIs in non-modded cubyz: cubyz:workbench
    Default value: none
    Syntax example: GUI cubyz:workbench
Ores

If you specify the block class ore, you can set a few more attributes that define the world generation of these ores:

  • how many veins there are on average in each chunk.
    Default value: 0
    Syntax Example: veins 10
  • how big each vein is on average.
    Default value: 0
    Syntax Example: size 15
  • maximum height of ore veins.
    Default value: 0
    Syntax Example: height 128

Example block file(addons/cubyz/blocks/coal_ore):

class ore
hardness 40
veins 10
size 15
height 128
drop cubyz:coal
model cubyz:block.obj
texture cubyz:coal_ore

Recipes

In each file you can define shortcuts for item names like this:

L = cubyz:oak_log
T = cubyz:oak_top
P = cubyz:oak_planks

Then you can create any amount of recipes you want. If you want a recipe to contain empty spaces, you can use 0 instead of the item name or shortcut.

shapeless recipes:

You can define shapeless recipes using the shapeless keyword simply by enumerating all items (or their respective shortcut) seperated by spaces(or other space-like symbols like tabs) and stating the result(and how many items you want to get):

shapeless
L
result 4*P
shaped recipes:

You can define shaped recipes using the shaped keyword. Afterwards you have to define the shape of your recipe using items. And at the end you need to specify the result:

shaped
P P
P P
result cubyz:workbench

Biomes

biome files are seperated in two parts:

1. general attributes
  • type(the cubyz world is divided into different climate zones and height levels)
    Default value: ETERNAL_DARKNESS
    Syntax Example: type FOREST
    For a full list of available types look into the code or ask on our discord server.
  • height arguments(minimal height, maximal height)
    Default value: 128
    Syntax Example: height 120 to 256
  • chance(how often this biome will generate compared to others of similar type)
    Default value: 1
    Syntax Example: chance 1
  • roughness(how rough the terrain is. Can be any value >= 0 where 0 means no roughness at all, 0.3 means slightly rough, 1 means pretty rough, 2-4 means super rough, 100 means random spikes, higher values were not tested)
    Default value: 1
    Syntax Example: roughness 0
  • rivers(if rivers should start in this biome)
    Default value: yes
    Syntax Example: rivers
  • ground structure: how the surface blocks are structured.
    Default value: stone
    Syntax Example: ground_structure cubyz:grass, 2 cubyz:dirt, 1 to 5 cubyz:cobblestone
2. structures

After the structures: keyword, you can add structures that get generated by cubyz-intern or modded structure generators. Currently there are:

cubyz:simple_vegetation

Columns of a certain block type with a certain height and chance: cubyz:simple_vegetation cubyz:cactus 0.01 3 2 will generate a cactus on every 100th block with a height of 3 to 3+2 blocks.

cubyz:simple_tree

Columns of a certain block type with a certain height and chance: cubyz:simple_tree cubyz:oak_leaves cubyz:oak_log cubyz:oak_top 0.05 4 3 will generate an oak tree on every 20th block with a 4 to 4+3 block high stem.

Example file(addons/cubyz/biomes/forrest):

temperature 110
humidity 0.6
height 102-114-140
ground_structure cubyz:grass, 2 to 3 cubyz:dirt
roughness 0.1

structures:
	cubyz:simple_tree cubyz:oak_leaves cubyz:oak_log cubyz:oak_top 0.05 7 3
	cubyz:simple_vegetation cubyz:grass_vegetation 0.3 1 0

Materials

Materials define what properties a tool has depending on what parts of it are made from this material.

Base properties
  • head durability: how much durability is added to the tool if the head is made of this material. Negative values are also possible.
    Default value: 0
    Syntax Example: head 20
  • binding durability: how much durability is added to the tool if the binding is made of this material. Negative values are also possible.
    Default value: 0
    Syntax Example: binding 10
  • handle durability: how much durability is added to the tool if the handle is made of this material. Negative values are also possible.
    Default value: 0
    Syntax Example: handle 10
  • damage: how much damage is dealt by the tool if the head is made of this material.
    Default value: 0
    Syntax Example: damage 7.5
  • speed: how fast the tool breaks blocks if the head is made of this material.
    Default value: 0
    Syntax Example: speed 2.5
  • level: what mining level the tool can break if the head is made of this material.
    Default value: 0
    Syntax Example: level 2
Modifiers

Each material can also add certain modifiers to the tool. These can have active(on use) and passive(per tick) effects. Currently there are only a few modifiers(cubyz:falling_apart and cubyz:regrowth).
Modifers have also a strength value which determine how strong the effect is. If multiple parts add the same modifier, the effect will get stacked.
Modifiers can be added like this:
modifier cubyz:falling_apart 2
Or more general:
modifier *mod*:*modifier name* *strength*

You can add as many modifiers as you want.

Crafting Items

These are the items from which you can make the parts of the tool.
Each item also has an associated material value which determines how many items are needed to create head/binding/handle of certain tools. Here is a list of how much material value is needed for each tool part:

Part Material Value
Binding 50
Handle 50
Sword Blade 200
Axe Head 300
Pickaxe Head 300
Shovel Head 100

New items can be added like this:
cubyz:stick 50
or more general:
*mod*:*item name* *material value*

Example file(addons/cubyz/materials/wood):

head -20
binding 50
handle 20

damage 0.1
speed 1
level 1

modifier cubyz:regrowth 1
modifier cubyz:falling_apart 5

cubyz:stick 50
cubyz:oak_planks 100
cubyz:oak_log 150
cubyz:oak_top 150

Existing Addons

If you made an addon and want it to appear on this list, contact us on discord so we can see if it contains any inappropiate content and if it doesn't, we'll add it to the list.

Currently there is no addon here(apart from the base addon) :(