isPeaceful

User avatar
napodan
Member
 
Posts: 42
Joined: Mon Sep 29, 2014 12:07
GitHub: napodan

isPeaceful

by napodan » Thu Oct 09, 2014 11:20

Hi everyone,

I'm news in minetest and I try to understand how mobs mods work. I saw that in minetest.conf we can set only_peaceful_mobs to have only peaceful mobs or not. I looked into the C++ code and found that if it's true, the program calls isPeaceful on every ServerActiveObject. I found that isPeaceful always return true. Is there a way to override this method in lua script (every mob may override this method) ?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: isPeaceful

by rubenwardy » Thu Oct 09, 2014 17:05

Don't look into the C++ code to work out how they work, mobs mods are free standing. isPeacefull will be an outdated piece of code.
 

User avatar
napodan
Member
 
Posts: 42
Joined: Mon Sep 29, 2014 12:07
GitHub: napodan

Re: isPeaceful

by napodan » Thu Oct 09, 2014 17:57

So if I understand correctly, every mobs mods needs to treat "only_peaceful_mobs" themselves (like in simple mobs for example).
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 13 guests

cron