#Despawn an entity out of player chunk
1 messages · Page 1 of 1 (latest)
"minecraft:despawn": {
"despawn_from_chance": false,
"despawn_from_inactivity": false,
"despawn_from_simulation_edge": true
}
I want to despawn the entity when a certain condition is met and activate an event, for that reason, I cannot make it spawn automatically using that component
You just want to despawn an entity when a certain condition is met right?
yes
This component supports filters.
Example:-
"minecraft:despawn":{
"despawn_from_distance": {
"max_distance": 128,
"min_distance": 32
},
"despawn_from_chance": false,
"despawn_from_inactivity": false,
"despawn_from_simulation_edge": true,
"min_range_inactivity_timer": 30 ,
"min_range_random_chance": 800,
"remove_child_entities": false,
"filters":{"test": "has_damage", "target": "self"}
}
hmmm I don't know if it would work for what I'm looking for. The entity I'm using spawns when the player sleeps, but if the player go too far and sleep in another bed, I want the previous entity to despawn and summon another
thats why I have the chunks problem
What's the purpose of the entity?
You might want it to always ride the player.
In case if it's a dummy entity.
or use minecraft:tick_world component in your entity.
So, it can always run!
I am trying to generate from time to time a group of mobs that raid your house
isnt that laggy? like tickingarea
The minimum radius you can set is two. I'm not sure it's like 2 blocks or 2 chunks but should be laggy if these mobs are not together and spread out everywhere.
So why can't you use despawn_from_simulation_edge ? This will despawn them as soon as they are at the edge of the simulation distance.
and you can spawn the other when the players sleep again.
because if the player does not sleep in another bed, he does not have to despawn
but the players would have to sleep every time they go away.
Hmm, for that you'll have to use the tick component because there is no way you can run an event on an entity that's not loaded.
or you can probably add something to the player or a scoreboard so when they load again they despawn.
I guess I have no choice but to use this.
its too laggy