Solved Getting objects from block metadata

Discussion in 'Spigot Plugin Development' started by SilverNinja555, Sep 14, 2018.

  1. I set a block to its owner (a NMS zombie instance) using metadata, but how would I retreive the object? there is no asObject() method.
     
  2. Senmori

    Senmori Retired Resource Staff
    Retired Patron

    what?
    Show us the code you've written and maybe someone can help you?
     
  3. MiniDigger

    Supporter

    you _really_ don't want to store such complex objects in metadata. store the entity id.
     
  4. If you're talking about Spigot's Metadata framework, the method you're looking for would be MetadataValue#value, which returns an Object.
     
  5. I'm just storing a string UUID now