#How would I make a block detect other blocks to make a summoning structure?

1 messages · Page 1 of 1 (latest)

opal bough
#

I'm trying to make this into a summoning structure that spawns my mob when the pumpkin is placed

torpid jolt
#

ahh I see that's what you were trying to do

#

the last one the you place should be the pumpkin right?

#

you are gonna need to use script on that

opal bough
#

I'm setting up a script right now

solar coral
#

oh, I think I got it

torpid jolt
opal bough
#

I'm learning how to script

torpid jolt
#

yep learn the basics first

opal bough
torpid jolt
#

that's cool mob

torpid jolt
opal bough
torpid jolt
#

ahhh I see thank you

opal bough
#

Yw

undone briar
opal bough
opal bough
undone briar
solar coral
opal bough
solar coral
peak bobcat
# opal bough I'm trying to make this into a summoning structure that spawns my mob when the p...

that's quite simple really, all you need to do is to check if the block below is magma, if the blocks on the north and south or east and west are magma, and finely check if the block below is also magma if all the conditions are met, replace them with air and spawn your entity

world.afterEvents.playerPlaceBlock.subscribe((event) => {
  const pumpkin = event.block
  const core = pumpkin.below()
  if (pumpkin.typeId != "lit_pumpkin") return
  if (core.typeId != "magma") return
  if (core.below().typeId != "magma") return
  if (!((core.north().typeId != "magma" && core.south().typeId != "magma") || (core.east().typeId != "magma" && core.east().typeId != "magma"))) return
  spawnGolem(core)
})
opal bough
#

I've got a working script

#

Already

peak bobcat
#

alright, did you use the same method?

opal bough
peak bobcat
#

glad it works

opal bough
#

Same