-
Notifications
You must be signed in to change notification settings - Fork 14
Tile Entities
Some attributes are used by all types of tile entities:
{
"id": "mytileentity",
"modules": [
{
"type": "inventory",
"name": "inv1",
"size": 27
}
]
}
-
id: This is the unique id of the tile entity. This is used to reference the tile entity in blocks. This has to be all lowercase and must not contain spaces. It only has to be unique in your mod.
-
modules: This is a list of tile entity modules. These modules add functionality to the tile entity.
All modules have the following attributes:
{
"type": "inventory",
"name": "inv1"
}
- type: This is the type of the module. Depending on this, more attributes are available.
- name: This is the name of the module. It has to be unique in the tile entity only. This is used to reference the module, for example in a gui file.
Type name: inventory
This module adds a simple inventory to the tile entity. It has the following attributes:
{
"size": 27,
"sides": ["up", "down", "east", "west"]
}
- size: This defines how many slots the inventory has.
- sides: This defines from what sides the inventory can be accessed, for example by the hopper. The default is all sides.
Type name: crafting
This module adds crafting functionality to the tile entity. It has the following attributes:
{
"rows": 2,
"columns": 3,
"recipeList": "mymod:myrecipelist"
}
- rows, columns: The number of rows and columns of the crafting area. Both have to be 1, 2 or 3. Default value is 3.
- recipeList: This defines what recipes can be used. For vanilla recipes use "minecraft:vanilla". Default value is "minecraft:vanilla".
This module has rows * columns+1 slots: rows * columns for the input area and one for the recipe output. Input slots are numbered from left to right and top to bottom.
Type name: machine
This module adds machine functionality to the tile entity, for example a furnace. It has the following attributes:
{
"inputSlots": 2,
"outputSlots": 2,
"fuelSlots": 2,
"cookTime": 150,
"recipeList": "mymod:machinerecipes",
"fuelList": "mymod:machinefuel",
"sidesInput": ["up"],
"sidesOutput": ["down"],
"sidesFuel": ["north", "south", "east", "west"],
"inputTanks": ["input_tank"],
"outputTanks": ["output_tank"]
}
- inputSlots: The number of input slots that the machine uses. Default value is 1.
- outputSlots: The number of output slots that the machine uses. Default value is 1.
- fuelSlots: The number of fuel slots for this machine. Note that two slots mean that the machine burns two items at once. Setting this to 0 means the machine works without fuel. Default value is 1.
- cookTime: The number of ticks a recipe takes to finish. If a recipe has its own cook time, the recipes time is used instead. Default value is 200.
- recipeList: This defines what recipes can be used. For vanilla furnace recipes use "minecraft:vanilla". Default value is "minecraft:vanilla".
- fuelList: This defines what items can be used as fuel. For vanilla furnace fuel use "minecraft:vanilla". Default value is "minecraft:vanilla".
- sidesInput, sidesOutput, sidesFuel: This defines from what sides the different slots can be accessed, for example by the hopper. Default value is as seen above.
- inputTanks, outputTanks: Defines the tanks that are used for the input and output of a recipe that uses fluids. The tanks have to be modules of the same tile entity. Default value is no tanks at all.
The slots are numbered like this: input then output then fuel.
Type name: tank
This module adds a fluid tank to the tile entity. It has the following attributes:
{
"capacity": 10000,
"canDrain": true,
"canFill": true,
"sides": ["north", "south", "east", "west", "up", "down"]
}
- capacity: The tank's capacity. Default values is 10000.
- canDrain: If the tank can be drained. Default value is true.
- canFill: If the tank can be filled. Default values is true.
- sides: Defines the sides from which the tank can accessed by clicking with a fluid container, pipe, etc. Default value is all sides.
Type name: tileentity:simple
This tile entity has no special functionality. There are no additional attributes for this tile entity.