mirror of
https://github.com/Minestom/Minestom.git
synced 2024-11-25 20:15:52 +01:00
Created Data (markdown)
parent
5982c7d3e4
commit
d9d1a97a2d
16
Data.md
Normal file
16
Data.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
A data object is basically a Map wrapper. A DataContainer is an object which contains a Data object, there are multiple containers such as Instance, ItemStack, Entity, Block (in a particular way, the data object is specified when setting a block).
|
||||||
|
|
||||||
|
Basically, it is used to link values to an element of the game.
|
||||||
|
|
||||||
|
For instance:
|
||||||
|
|
||||||
|
```java
|
||||||
|
Data data = dataContainer.getData();
|
||||||
|
data.set("test", 1, Integer.class);
|
||||||
|
int test = data.get("test");
|
||||||
|
```
|
||||||
|
|
||||||
|
## Serializable data
|
||||||
|
A SerialiableData object can, as the name imply, be serialized.
|
||||||
|
|
||||||
|
It should be used in hand with our [Storage system](https://github.com/Minestom/Minestom/wiki/Storage)
|
Loading…
Reference in New Issue
Block a user