#entities despawning
1 messages · Page 1 of 1 (latest)
when restarting the server i think
i'm not actually sure but read this #1449975064094048337 message
maybe ask buddelbubi about the entity issue
Yeah i also had same thing but idk is it fixed
i'm using the latest build
Self coded? Or from my Hologram plugin?
yours
doesn't work unforunately
hey
i solved this after hours of thinking
use isPersistent function on your entity class
and set it to true
oh okay
shouldn't this be implemented on the servers side at some point instead of all plugins?
yeah cause normal entities despawn
idk about normal entities but proably there is a problem if it isn't implemented yet
they are
atleast some of them
yeah
erm
it doesn't work...
i checked if the entity is persistent and restarted the server but it still disappears
i also changed the hologram plugin to set the entities persistency to true
custom entity isPersistent is already there, by default any entity that is not persistent will despawn, this is Bedrock behavior to optimize the server.
if you create a custom entity and want it to be persistent you have to set it
vanilla entities that is persistent as example are NPCs, villagers and few others
but if you setup a custom entity that extend Human, then in that case aside of isPersistent tag you also need to reload the skin data on init, as these entities are not mobs oriented as others, they will act like players
if you dont need to have it like human, npc would work
you only use human type if you need to load data from players, like skin, etc..
it still despawns when persistent though?
holograms extend entity not entityhuman
paste your code here
it's not my plugin, it's buddelbubis
but i changed persistence here:
CompoundTag tag = Entity.getDefaultNBT(position);
ListTag<StringTag> linesTag = new ListTag<>(lines.stream().map(StringTag::new).toList());
tag.putList(EntityHologram.LINES, linesTag);
EntityHologram hologram = new EntityHologram(position.getChunk(), tag);
hologram.setNameTag(identifier);
hologram.setPersistent(true);
hologram.spawnToAll();
return hologram;
}```
i also made a command to check if nearby entities are persistent to validate this
I dont know the code of Buddel`s plugin, better him to guide you here then, but regarding the persistance, you can try to add setPersistent on init, test if it works
alr
did it work? @austere prism
You may need to set persistent in definition tho