Page 1 of 1

Despawn

PostPosted: Thu Aug 24, 2017 14:48
by elettrico
Hi, don't know if it's the correct forum to post to, move if needed.

I post it here because I think it's a bug not to have a command for despawing mobs.

Is there a way to despawn all mobs or despawn all mobs spawned by one mod?
I war trying the scifi mod in a world (server), now I've removed it but all the robots appears as "unknown" and keep wandering. How can I tell minetest to remove all mobs unknown, or from "scifi" mod, or alternatively ALL mobs?

Thank

Re: Despawn

PostPosted: Thu Aug 24, 2017 16:23
by v-rob
I know that the command /clearobjects clears all entities, but this would also get rid of minecarts and words on signs if you have signs_lib and it would remove a few other things as well. If you have many entities on you're server, then you could have a timeout happen. Think carefully before doing this.

BTW, you should probably test mods you aren't sure you want in a singleplayer test world before putting them in a server. A server is hard to fix, but a test world can be deleted.

Re: Despawn

PostPosted: Thu Aug 24, 2017 18:06
by elettrico
Yes I know about clearobject, and what you say is true. So, if there's no way to delete all entities from one mod I think I have to live with it. It's a pity.
And yes, it is true I should have done my tests locally: in fact, I've done it. But in an "empty" world I didn't notice robots could destroy things, and that is not mentioned in the mod documentation. When I tried it in my "real" world I've start to notice broken houses, etc, and later realized that's the work of sci-fi mobs!

Re: Despawn

PostPosted: Fri Oct 27, 2017 21:34
by sorcerykid
One possible workaround is to redefine the on_activate( ) method of the unwanted entity.

Code: Select all
minetest.register_entity( "example:bad_entity", {
        on_activate = function( self )
       self.object:remove( )
   end,
} )


Admittedly, this doesn't perform a database-wide purge. However, it's guaranteed to remove the entity whenever the mapblock is reloaded.

Re: Despawn

PostPosted: Thu Nov 30, 2017 11:27
by christoferlevich
I am kind of glad I am not alone. I was going crazy because my signs would hold and then out of no where - I'd loose the text rendering on the sign, though the text was still 'in the sign;. Clearobjects.... yikes... thanks for confirming.