1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

how to add nbt on an item

Discussion in 'Development' started by Levi, May 4, 2018.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    how can i add nbt on an item
     
  2. Michel5F30

    Michel5F30 Silverfish

    Messages:
    22
    Did you try "\pocketmine\item#getNamedTag" and "\pocketmine\item#setNamedTag"?
    EDIT: Make sure to call #getNamedTag before #setNamedTag and re-use the given object to not overwrite other things of the item (except the things you change).
     
    Last edited: May 4, 2018
  3. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    tried and didn't work
     
  4. Michel5F30

    Michel5F30 Silverfish

    Messages:
    22
    • What did you try (post sourcecode)
    • What did not work as you expect (what did you expect and what happened really)
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.