Despawn

Post Reply
elettrico
Member
Posts: 25
Joined: Thu Jul 20, 2017 20:00

Despawn

by elettrico » Post

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

User avatar
v-rob
Developer
Posts: 970
Joined: Thu Mar 24, 2016 03:19
GitHub: v-rob
IRC: v-rob
Location: Right behind you.

Re: Despawn

by v-rob » Post

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.
Core Developer | My Best Mods: Bridger - Slats - Stained Glass

elettrico
Member
Posts: 25
Joined: Thu Jul 20, 2017 20:00

Re: Despawn

by elettrico » Post

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!

User avatar
sorcerykid
Member
Posts: 1841
Joined: Fri Aug 26, 2016 15:36
GitHub: sorcerykid
In-game: Nemo
Location: Illinois, USA

Re: Despawn

by sorcerykid » Post

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.

User avatar
christoferlevich
Member
Posts: 325
Joined: Thu Dec 01, 2016 23:44
GitHub: ChristoferL
Location: Athol, Massachusetts

Re: Despawn

by christoferlevich » Post

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.
everything can be a learning experience...

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests