Skip to content

Commit

Permalink
Remove the usage of the word "tile" entity
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Jun 20, 2024
1 parent e652751 commit 7396821
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions wiki/Using-the-NBT-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ NBT.modifyComponents(item, nbt -> {
});
```

### Working with tiles/entities
### Working with (block-)entities

Working with entities and tile entities is similar to working items.
Working with entities and block entities is similar to working items.

#### Accessing vanilla nbt

The example code for entities is applicable for tile entities too.
The example code for entities is applicable for block entities too.

```java
// Obtain data
Expand All @@ -200,10 +200,10 @@ NBT.modify(entity, nbt -> {

#### Accessing custom data

For reading/storing custom data on tiles/entities, you should use methods that end with PersistentData.
For reading/storing custom data on (block-)entities, you should use methods that end with PersistentData.

> [!IMPORTANT]
> When working with tile entities, make sure that the block entity exists in the world.
> When working with block entities, make sure that the block entity exists in the world.
>
> For example, you may not be able to add data to a chest in `BlockPlaceEvent` because the chest hasn't been placed yet. In such case, you can delay your actions by one tick or set the block to chest manually.
Expand All @@ -224,7 +224,7 @@ NBT.modifyPersistentData(entity, nbt -> {
#### Simulate the "/data merge" command

Applicable for items/tiles/entities/etc.
Applicable for items/block entities/entities/etc.

```java
NBT.modify(zombie, nbt -> {
Expand All @@ -234,7 +234,7 @@ NBT.modify(zombie, nbt -> {

### Working with blocks

You can store data in tile entities (block entities like chest, furnace, etc.) using the examples from the section above, but normal blocks do not have the nbt data.
You can store data in block entities (block entities like chest, furnace, etc.) using the examples from the section above, but normal blocks do not have the nbt data.

Thus, you have to use your own block data storage to store custom block data.

Expand Down Expand Up @@ -313,7 +313,7 @@ String json = nbt.toString();
ReadWriteNBT nbt = NBT.parseNBT(json);
```

#### Tiles/Entities
#### (Block-)Entities

```java
// Saving
Expand Down
2 changes: 1 addition & 1 deletion wiki/_Sidebar.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

* [Basics](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API#basics-overview)
* [Items](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API#working-with-items)
* [Tiles/Entities](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API#working-with-tilesentities)
* [Block-Entities/Entities](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API#working-with-(block-)entities)
* [Blocks](https://github.com/tr7zw/Item-NBT-API/wiki/Using-the-NBT-API#working-with-blocks)

### Extras
Expand Down

0 comments on commit 7396821

Please sign in to comment.