Player PersistentDataContainer TAG_CONTAINER, need help.

Discussion in 'Plugin Development' started by jonathanpecany, Dec 6, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    jonathanpecany

    So the other day I asked a question of how to get an Entity NBTBase, which I found an alternative to. You can view my latest posts on my alternative in the link I provided.

    So, the main reason I asked there is so I have a way to Organize it better so when editing it, it isn't all jumbled up where it is hard to find everything if I have lots of data. I have not yet implemented into the Entity yet as I wanted to do a couple of steps before doing that when I came across something very annoying, which shows no error or nothing.

    When trying to append like a String Persistent Data Type to the Tag Container, it doesn't actually save it to the NBT file. Which again, I check using the Universal Minecraft Editor (Link provided). It creates the Tag Container quite find under BukkitValues in the player uuid-named compound (aka Tag). I also went a bit further in testing to see if it is for everything but Tag Container (For some odd reason) so I created a simple string and it worked quite find.

    Does anyone know what is going wrong, I know I am doing everything correctly. It worked with Entities, which I know from when I first tested using dataType TAG_CONTAINER. So why isn't it working for Player as well, makes no sense to me.

    A sample example code of the similar code I am working with should be in the post I provided.

    I'll try to constantly update on progress of further problems that originated from this and if I solved it on my own or not.

    Thanks in response.
     
  2. Offline

    jonathanpecany

  3. Offline

    jonathanpecany

  4. Offline

    jonathanpecany

    Bump yet again, I still need help on this.
     
  5. Offline

    Kars

    I have no idea what you are saying. Can you try to summarize it in like 3 sentences?
     
  6. Offline

    jonathanpecany

    @Kars I need help in creating compounds inside players. It works for entities but doesn't work for players. Compounds are like folders in NBT.
     
  7. Offline

    Kars

    For what purpose. Can't you just use configs or something?
     
  8. Offline

    jonathanpecany

    @Kars Purpose is to store data efficient. And can't use configs as most things will use PersistentData and just will make it not efficient and confusing for future reference.
     
  9. Offline

    Kars

    @jonathanpecany perhaps a bad workaround could be to serialize your data and store it in configs as JSON strings.
     
  10. Offline

    jonathanpecany

    @Kars Don't know about that but would my idea work though with persistent data for players?
     
  11. Offline

    Kars

    @jonathanpecany you can serialize any Java object into JSON format and deserialize it back into an object later.
    Google it.
     
Thread Status:
Not open for further replies.

Share This Page