Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

waterbased mobs spawn depsite protection #81

Closed
Bastrabun opened this issue Aug 28, 2021 · 6 comments
Closed

waterbased mobs spawn depsite protection #81

Bastrabun opened this issue Aug 28, 2021 · 6 comments

Comments

@Bastrabun
Copy link

A player of mine has a swimming pool in a savanna biome, in a protected area of his. He often gets snakes spawned in there.

Please make them respect protections

@berengma
Copy link
Owner

I will think about it.

@berengma
Copy link
Owner

I do not want to generally forbid them to spawn in protected areas. Maybe you have an other idea ? Like something which could be crafted and placed to scare them away ?

@Gundul42
Copy link
Collaborator

Gundul42 commented Dec 8, 2021

No idea ? Can be closed I guess.

@berengma
Copy link
Owner

berengma commented Apr 7, 2022

I checked code and Snakes should not spawn in protected areas.
Was that really protected ? And by which protection mod ?

@berengma berengma closed this as completed Apr 7, 2022
@fluxionary
Copy link

fluxionary commented May 28, 2022

The protection mod is "areas". I solved @Bastrabun's issue by altering our fork to properly check for protection, but this change got wiped when we merged in recent updates, and snakes, crocs, etc. are again spawning in protected areas.

Note that this is really only an issue w/ hostile mobs. No other mod we use spawns monsters in players' houses.

My previous fix was a bit hacky, which was why I never submitted it. If/when I get around to fixing it again, I'll submit what I do. I remember the code needed a whole lot of TLC in general, though.

@berengma
Copy link
Owner

Spawning happens in the spawn function only. So whatever is not meant to be spawned, just add a is_protected check right before the final entity is spawned in the game. That is pretty easy because you just have to search for "snake" in spawn.lua and then add the if minetest.is_protected(pos) then [...] end.
I remember like I had a global flag for not spawning in protected areas, maybe not for snakes though, to make it more realistic, I do not remember anymore :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants