Skip to content

Commit

Permalink
Fixup modifyMeta example
Browse files Browse the repository at this point in the history
  • Loading branch information
SoSeDiK committed Dec 28, 2024
1 parent 3bb0bdd commit aa35ee8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wiki/Using-the-NBT-API.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ Alternatively, you may safely modify ItemMeta inside the NBT scope:
// Updating ItemMeta using NBT
NBT.modify(itemStack, nbt -> {
nbt.setInteger("kills", nbt.getOrDefault("kills", 0) + 1);
nbt.modifyMeta((meta, readOnlyNbt) -> { // Do not modify the nbt while modifying the meta!
nbt.modifyMeta((readOnlyNbt, meta) -> { // Do not modify the nbt while modifying the meta!
meta.setDisplayName("Kills: " + readOnlyNbt.getOrDefault("kills", 0));
});
// Do more stuff
Expand Down

0 comments on commit aa35ee8

Please sign in to comment.