#Can I place structures like a structure block would?

20 messages · Page 1 of 1 (latest)

ember pilot
#

I know there are no vanilla commands for placing structures, but maybe kubejs can do it? And with place structure I dont mean worldgen, just literal placing of predicate structures anywhere whenever i tell it to

elfin walrusBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

restive grail
#

yep
using a structure block, which can be activated with a redstone signal

foggy rapidsBOT
#

[Quote ➤](#archived-example-scripts message) A script that spawns a structure when the player first joins, useful for skyblock type packs.
I recommend you combine this with a dimension json in the data folder to overwrite the overworld with your skyblock type world.

let structure_name = 'modpack:structure'
onEvent('player.logged_in', event => {
    if (!event.server.persistentData.loaded) {
        let d = { //this defines the position the strucututre will spawn at.
            x: Math.floor(event.player.x),
            y: 64, //this is constant, but it doesnt have to be
            z: Math.floor(event.player.z),
            id: event.player.id
        }
        event.server.scheduleInTicks(1, c => { //make sure the chunks are loaded before trying to set the block
            c.server.runCommandSilent(`setblock ${d.x} ${d.y} ${d.z} minecraft:structure_block{ignoreEntities:1b,powered:0b,seed:0L,posX:0,mode:"LOAD",posY:1,sizeX:12,posZ:0,integrity:1.0f,showair:0b,name:"${structure_name}",id:"minecraft:structure_block",sizeY:10,sizeZ:12,showboundingbox:0b}`)
            c.server.runCommandSilent(`setblock ${d.x} ${d.y - 1} ${d.z} minecraft:redstone_block`)
            c.server.runCommandSilent(`fill ${d.x} ${d.y} ${d.z} ${d.x} ${d.y - 1} ${d.z} air`)//get rid of the structure and redstone block
            c.server.persistentData.loaded = 1

            c.server.runCommandSilent(`tp ${d.id} ${d.x} ${d.y} ${d.z}`) //these numbers should be half the size of the structure, so the player and spawn ends up in the middle. will need tweaking for your structure.
            c.server.runCommandSilent(`setworldspawn ${d.x - 6} ${d.y + 1} ${d.z - 6}`) 
        })
      }
})
ember pilot
#

So would I have to place a structure block with custom NBT using kjs? and then powering it

restive grail
#

theoretically you can swap the commands out for actual block set methods, but with all the nbt and stuff its easier doing a command

ember pilot
#

thanks a lot

dense drift
#

same thing ofc happens when I place it with a structure block, but weirdly the schematic stores all the chest stuff fine

#

Could the schematic being too large be the issue?

dense drift
#

nvmd just seems create schematics dont work

empty moon
#

@ember pilot cleaner way without commands nor structure blocks

#

#1100369951308664933

empty moon
#

OR you can use kube utils

#

which has a function to do this

#

i would use that

#

but i was on fabric so i made that

dense drift
#

oh well, Ive used the thing above already, but thanks

#

(chicken stealer is my alt)