Jump to content

Getting Spawner (Dungeon) Block and Position


Recommended Posts

Sorry if this has been asked - I've been searching for a while and couldn't find an answer.

Is there a performance-friendly way to grab a block if it exists in a chunk? I would assume I would use a BiomeLoadingEvent to do so?

Here's pseudocode based on what I've generally been trying so far:


	public void ChunkBuilt(BiomeLoadingEvent e)


Basically, I'm looking to determine if a dungeon spawner has spawned, and identify its world position.



Link to comment
Share on other sites


I'm trying to identify if a monster spawner is placed in the world, and, where it is.

I've been playing around with BiomeLoadingEvent with no luck, likely due to, as you said, the world not being loaded yet.

Next, I was trying to see if I could monitor for the spawn of the spinning entity inside the spawner, hoping I could get its block position on a SpecialSpawn event. It would have been something like:

	public void onEntitySpawn(SpecialSpawn e) {
		Entity Entity_Class = e.getEntity();
		if(Entity_Class.getType() == EntityType.SPINNING_SPAWNER_ENTITY)
			BlockPos Block_Position = Entity_Class.Entity_Class.blockPosition();



What I'm trying to achieve: Find / identify where a monster spawner is if it spawns naturally in the world, like, in a dungeon.

I'm not actually sure if this is possible, as I could see obvious performance issues with finding blocks through something like an x,y,z loop. I was hoping there was a built-in way or hack to find spawner blocks as they spawn in the world, but haven't found any code yet that would help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.