mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-23 11:33:23 -04:00
Updated Addons (markdown)
parent
5654d9e066
commit
70df763b51
233
Addons.md
233
Addons.md
@ -4,234 +4,9 @@ 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)
|
||||
1. Locate the `assets` 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`).
|
||||
3. Decide what things you want to add and add the corresponding folder(`items`, `blocks`, `recipes`, `biomes`, `tools`, etc.).
|
||||
4. Create a zon ("Zig Object Notation") file in the folder that represent the item/block/biome name(`name.zig.zon` or just `name.zon`).
|
||||
<br> 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.
|
||||
<br> Put the texture of your item in `*cubyz install path*/addons/*addon name*/items/textures`.
|
||||
<br> Copy the texture path(relative to the `textures` folder) into the file you made for your item:<br>
|
||||
```
|
||||
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`.<br>
|
||||
The block class determine if the block can be broken and with what tool you can break it.<br>
|
||||
Default value: `stone`<br>
|
||||
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.<br>
|
||||
Default value: `1`<br>
|
||||
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.<br>
|
||||
Default value: `none`<br>
|
||||
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<br>
|
||||
Default value: `undefined`<br>
|
||||
Syntax example: `model cubyz:block.obj`
|
||||
- a texture for that 3d model. The texture should be inside `addons/*addon name*/blocks/textures`.<br>
|
||||
Default value: `undefined`<br>
|
||||
Syntax example: `texture cubyz:cactus` if the texture is in `*cubyz install path*/addons/cubyz/blocks/textures/cactus.png`
|
||||
- wether the block is transparent.<br>
|
||||
Default value: `no`<br>
|
||||
Syntax example: `transparent yes`
|
||||
- wether the model of the block is transparent(meaning it is not a cube).<br>
|
||||
Default value: `no`<br>
|
||||
Syntax example: `viewThrough yes`
|
||||
- light absorption in case the block is transparent.<br>
|
||||
There are four light channels: sun, red, green, blue. The value is given as hexadecimal: `0xssrrggbb`<br>
|
||||
Default value: `0x00000000`<br>
|
||||
Syntax example: `absorbedLight 0x06080008`(The block lets mostly green light through)
|
||||
- light emission: how much light the block emits<br>
|
||||
There are four light channels: sun, red, green, blue. The value is given as hexadecimal: `0xssrrggbb`<br>
|
||||
Default value: `0x00000000`<br>
|
||||
Syntax example: `emittedLight 0x00ff8000`(The block emits orange light)
|
||||
- wether the block is degradable(trees can grow through it).<br>
|
||||
Default value: `no`<br>
|
||||
Syntax example: `degradable yes`
|
||||
- wether the block is solid.<br>
|
||||
Default value: `yes`<br>
|
||||
Syntax example: `solid no`
|
||||
- a GUI that is opened on left-click. Possible GUIs in non-modded cubyz: cubyz:workbench<br>
|
||||
Default value: `none`<br>
|
||||
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.<br>
|
||||
Default value: `0`<br>
|
||||
Syntax Example: `veins 10`
|
||||
- how big each vein is on average.<br>
|
||||
Default value: `0`<br>
|
||||
Syntax Example: `size 15`
|
||||
- maximum height of ore veins.<br>
|
||||
Default value: `0`<br>
|
||||
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)<br>
|
||||
Default value: `ETERNAL_DARKNESS`<br>
|
||||
Syntax Example: `type FOREST`<br>
|
||||
For a full list of available types look into the code or ask on our discord server.
|
||||
- height arguments(minimal height, maximal height)<br>
|
||||
Default value: `128`<br>
|
||||
Syntax Example: `height 120 to 256`
|
||||
- chance(how often this biome will generate compared to others of similar type)<br>
|
||||
Default value: `1`<br>
|
||||
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)<br>
|
||||
Default value: `1`<br>
|
||||
Syntax Example: `roughness 0`
|
||||
- rivers(if rivers should start in this biome)<br>
|
||||
Default value: `yes`<br>
|
||||
Syntax Example: `rivers`
|
||||
- ground structure: how the surface blocks are structured.<br>
|
||||
Default value: `stone`<br>
|
||||
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.<br>
|
||||
Default value: 0<br>
|
||||
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.<br>
|
||||
Default value: 0<br>
|
||||
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.<br>
|
||||
Default value: 0<br>
|
||||
Syntax Example: `handle 10`
|
||||
- damage: how much damage is dealt by the tool if the head is made of this material.<br>
|
||||
Default value: 0<br>
|
||||
Syntax Example: `damage 7.5`
|
||||
- speed: how fast the tool breaks blocks if the head is made of this material.<br>
|
||||
Default value: 0<br>
|
||||
Syntax Example: `speed 2.5`
|
||||
- level: what mining level the tool can break if the head is made of this material.<br>
|
||||
Default value: 0<br>
|
||||
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).<br>
|
||||
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.<br>
|
||||
Modifiers can be added like this:<br>
|
||||
`modifier cubyz:falling_apart 2`<br>
|
||||
Or more general:<br>
|
||||
`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.<br>
|
||||
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:<br>
|
||||
`cubyz:stick 50`<br>
|
||||
or more general:<br>
|
||||
`*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](https://discord.gg/XtqCRRG) 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) :(
|
||||
|
||||
- [cubyz base addon](https://github.com/PixelGuys/Cubyz/tree/master/cubyz-client/addons/cubyz)
|
||||
5. For examples please check the [base game content](https://github.com/PixelGuys/Cubyz/tree/master/assets/cubyz). I do not have the time to maintain a more extensive tutorial.
|
Loading…
x
Reference in New Issue
Block a user