How can i check for player made structures? And how do i make mobs not spawn unless a flag is set to true?

Started by DeltAxShaRD on

Topic category: Help with modding (Java Edition)

Last seen on 19:02, 19. Feb 2022
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How can i check for player made structures? And how do i make mobs not spawn unless a flag is set to true?
Thu, 06/18/2020 - 01:58 (edited)

Similar to iron golems. its like an activation structure. how do i check a 3x3 area for blocks?

 

diagram of blocks i want to use
     
  Obsidian  
Stone Endstone Stone

like this ^ but i want a "fountain" structure. (3x3 square with the center being 1x2 tall)

 

Another thing is the fact that this structure is linked with certain mobs spawning. when the structure is built. certain mobs will start spawning. How do i prevent mobs from spawning unless this structure is built?

Can someone help me?

Edited by DeltAxShaRD on Thu, 06/18/2020 - 01:58
Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Similar to iron golems. its…
Thu, 06/18/2020 - 02:28

Similar to iron golems. its like an activation structure. how do i check a 3x3 area for blocks?

 

diagram of blocks i want to use

   

 Obsidian 

StoneEndstoneStone

like this ^ but i want a "fountain" structure. (3x3 square with the center being 1x2 tall)

I believe there are many forums on MCreator that show how to do that, and I believe videos.

Just check for blocks nearby either by using a tile entity, or preferably, on block placed.

 

Another thing is the fact that this structure is linked with certain mobs spawning. when the structure is built. certain mobs will start spawning. How do i prevent mobs from spawning unless this structure is built?

There are two methods that "pop" right in my head upon reading this;

1. Put a block in your structure that uses a tile entity and random number generation to spawn entities nearby.

2. Manually check for the nearby structure using,

ServerWorld::findNearestStructure

 

While number 2 is the "correct" way of doing it. Option 1 should be a lot easier to do, and will work just as well.

Last seen on 19:02, 19. Feb 2022
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh i should of clarified…
Thu, 06/18/2020 - 02:38

oh i should of clarified. the mobs spawn like any natural mob. just with a structure. similar to those herobrine mods.

Last seen on 04:35, 17. Jan 2021
Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, so you just want the…
Thu, 06/18/2020 - 02:41

Oh, so you just want the entity to spawn within the structure?

That's a lot easier and shouldn't need any custom coding.