#Can I place structures like a structure block would?
20 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
yep
using a structure block, which can be activated with a redstone signal
[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}`)
})
}
})
So would I have to place a structure block with custom NBT using kjs? and then powering it
theoretically you can swap the commands out for actual block set methods, but with all the nbt and stuff its easier doing a command
thanks a lot
Ticket closed!
When I try and place the thing, for some reason it doesnt contain chest inventory data
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?
nvmd just seems create schematics dont work