Hello everyone,
I am new here on the forums and new to Minecraft modding in general, but I do have intermediate Java experience and some modding experience with other games. I am working on my first basic mod and I thought it would be relatively simple... My hope is to create a block that, when placed, prevents hostile mobs from spawning within a (somewhat large) radius of its location. Creation of the block was pretty easy, and the code to prevent mob spawning seemed straight forward as well. Where I have now hit a wall is how to "attach" the code to prevent mob spawning to a block, and to have it only affect mobs within a certain radius / block range. Initially I tired subscribing to the EntityJoinWorldEvent within my blocks class, but I learned that this code executes regardless of the blocks existence in the world. My next idea was to keep track of my blocks in the world as they are placed, then iterate over them during the EntityJoinWorldEvent to see if the mob is within range, however creating / storing a list of my blocks as they are placed into the world seems to be a lot harder than I would have initially thought. The reality is that I don't know enough about Minecraft's systems to know if this is even the right way to get this done; Is there perhaps another event or function that is directly tied to an in-world block that I can use to execute my own code when events are fired? Is there any way to lookup or find the location(s) of blocks within loaded chunks using their name or ID? I know that there are mods that have already done similar things to what I am trying, so I'm pretty sure its possible and I'm just not looking at it right... Any help is much appreciated!
I was also curious if there is any 'official' or unofficial but widely recognized source for mod tutorials, API documentation etc. I have read through the Forge Documentation here, and have found links to the Forge 1.11.2 java-docs, but beyond that there seems to be a lack of modern (1.10+) forge documentation & tutorials. Are there any java-docs for 1.12.2 or 1.13 yet?