1.15.2 How to access/edit a Villager's gossip?

Discussion in 'Spigot Plugin Development' started by SilentPants, Feb 2, 2020.

  1. Hello, I am currently working on a plugin that allows a player to edit a villager's current gossips. I have code that gets me the villager I'm looking at, but I don't know where gossip data would be stored. I have looked at the metadata available for villagers, but it only contains things like type, level, and profession. I found an old thread that talks about editing the NBT tags, but it uses some seemingly deprecated methods. If someone could link me to a doc that describes how to access this data that would be nice, but I couldn't find anything myself searching through the spigot documentation. Thanks!
  2. Well it's not a feature that is directly in the spigot API, but if I remember correctly you can access NBT on mobs using the PersistentDataStorage API and the Minecraft namespace. There's some helpful information on the Minecraft wiki about how it's structured, so I recommend looking there first.