I am trying to make a LivingEntity that requests for a random item from an ArrayList when it spawns. It is working but every time I load into the world (Exit the world then join it again) it requests for a different item that it did before.
Ex. It asks for an Egg, then I rejoin the world and it now asks for a Block of Dirt.
I tried using EntityDataAccessor and I cannot figure out a way to use NBT data to save the item and then load it. Can someone point me towards the right direction on how to fix the issue?