Skip to content

Commit

Permalink
Update wiki code
Browse files Browse the repository at this point in the history
  • Loading branch information
tr7zw committed Mar 18, 2024
1 parent 75c8575 commit 85cc13a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wiki/Converting-Minecraft-Objects-to-NBT-and-Strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ ReadWriteNBT nbt = NBT.parseNBT(json);

```java
// Items
ItemStack itemStack = NBT.nbtToItemStack(nbt);
ItemStack[] itemStacks = NBT.nbtToItemStackArray(nbt);
ItemStack itemStack = NBT.itemStackFromNBT(nbt);
ItemStack[] itemStacks = NBT.itemStackArrayFromNBT(nbt);
// Entity/Tiles
In general "new NBTEntity(entity).mergeCompound(nbt)", but you might want to remove some data from the nbt first like the Location, uuid and entityId
// Gameprofile
GameProfile profile = NBT.nbtToGameProfile(nbt);
GameProfile profile = NBT.gameProfileFromNBT(nbt);
```

0 comments on commit 85cc13a

Please sign in to comment.