Modding:Block Entity: Difference between revisions
From Vintage Story Wiki
No edit summary |
CreativeMD (talk | contribs) |
||
Line 7: | Line 7: | ||
== The Texture Flipper == | == The Texture Flipper == | ||
Let's take our [[Basic block]] that we already created and make it flip between a gold and silver texture every 3 seconds. We'll use "Textureflipper" as our unique identifier for this new block entity. | Let's take our [[Basic Modding|Basic block]] that we already created and make it flip between a gold and silver texture every 3 seconds. We'll use "Textureflipper" as our unique identifier for this new block entity. | ||
== The BlockEntity == | == The BlockEntity == |
Revision as of 09:59, 26 October 2017
Introduction
A block entity is a construct that you can tack onto an existing block to give it additional functionality. Whenever a block should do something on a regular interval or store extra information, such as the contents of a chest block, you need a block entity.
The Texture Flipper
Let's take our Basic block that we already created and make it flip between a gold and silver texture every 3 seconds. We'll use "Textureflipper" as our unique identifier for this new block entity.
The BlockEntity
TBD
Attaching the Block Entity
Open the blocktype json file and add the following line. This will attach the block entity-to-be to our block.
The only new property is the class
:
entityClass: "Textureflipper",
Registering the Block Entity
TBD
The Mod Class
TBD
Testing
TBD
Distribution
TBD