I'm trying to make a custom block for a biome, and I want to control what creatures are allowed to spawn in it. However, I do not understand the line
this.canCreatureSpawn(type, world, x, y, z)
I been looking under block properties at the line that contains this, and at EnumCreatureTypes. But no matter if I put creature, monster, ambient or watercreature in the type, I get errors. I have been trying to find a tutorial on settting spawns for your block, but cannot find one. If anyone can help, or point me to a tutorial that explains more about this property, I would highly appreciate it.
You need to know Java properly to write mods. If you don't know it, there are plenty of resources to teach you it both online and offline.
You need to override the Block#canCreatureSpawn method in your Block class.
In your override of this method, check if type is equal to the desired EnumCreatureType value (e.g. EnumCreatureType.monster) and return either true (allow creatures of this type to spawn) or false (don't allow creatures of this type to spawn). You can either use if statements or a switch statement.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Yeah Im still learning. I read 2 books and watches some video tutorials. But I learn better practicing then just reading. Thanks for the help, I ended up using the BiomeLayer to disable the spawns instead, since I couldnt figure out how to get the statement to work in the block class