#structure that spawns only once and in specfic coordinates

1 messages · Page 1 of 1 (latest)

lethal arrow
#

i need to make a datapack that generate an structure at 00 coordinates and do not spawn anywhere else

supple kettle
#

use the /place structure command

maiden lodgeBOT
#
Place Syntax

/place feature <feature> [<pos>]
Place the configured feature.
/place jigsaw <pool> <target> <max_depth> [<position>]
Place the jigsaw.
/place structure <structure> [<pos>]
Place the configured structure feature.
/place template <template> [<pos>] [<rotation>] [<mirror>] [<integrity>] [<seed>]
Place the structure template. (Works like using the load button in the UI for a structure block.)

supple kettle
#

you might want to use /execute over to make it spawn on land

lethal arrow
#

sorry but i do not understand anything about datapacks is there is a tutorial for the basic?

supple kettle
lethal arrow
#

thanks

#

also do you know how to make certain items not spawn in certain chests?

supple kettle
#

yeah, the naturally spawning chest items are defined in a loot table. You just remove the items from the default loot table for the chest

lethal arrow
#

it is a modded loot table

#

a modded item

#

that spawns is vanilla structures

supple kettle
#

then the mod overrides the loot table, so you’ll have to make sure the datapack is on top of the datapack list when you install it

lethal arrow
#

when i extracted the jar files i found the loot tables should i just make the item weight zero?

#

and then put the new loot tables in a datapack?

supple kettle
#

that should work, and yeah just put them in a new datapack

lethal arrow
#

ok thx so much

#

bro what weight should i change?

supple kettle
#

change the set_count Count field to 0. That would probably be the easiest way to do it.

lethal arrow
#

ok thank you

lethal arrow
#

bro i changed it now it works well now i want to make a certain items drop from certain mobs

#

how to do that

open veldt
#

with loot tables

#

just watch any tutorial on loot tables 💀

lethal arrow
#

where is that brothere?

#

note i have zero experience in this

open veldt
#

u can use a loot table generator

#

its so much easier

lethal arrow
#

it is a modded item

#

also oid o not understand this

open veldt
#

should work fine

#

so how datapack work is they override or add content to mc in there format

#

u wanna override a loot table of a mob

#

so u have to follow mc format (data/minecraft/loot_tables/...)

#

and replace the file there

#

in ur datapack

lethal arrow
#

can i call u?>

open veldt
#

no

lethal arrow
#

😦

#

is there tutorial online for this

open veldt
#

yes

lethal arrow
#

or a mod that do this stuff

#

link plz

open veldt
lethal arrow
#

bro i made a loot table how to make mob get that loot table?

#

@supple kettle bro that syntax is wierd where should i write it and what does all the brackets mean

#

and the place command doe not work

supple kettle
#

ignore ethe bits about javascript because that's irrelevant here

lethal arrow
supple kettle
lethal arrow
#

uhhh

supple kettle
lethal arrow
#

yes i mad a loot

supple kettle
#

it generates the json for you

lethal arrow
#

table but to assign it to a mod

#

mob*

supple kettle
#

which mob?

lethal arrow
#

modded one

#

bro what i meant it looke wierd is what should i write in these brackets

supple kettle
lethal arrow
#

i have a structure i want to generate the first time a player joins the world in a specfic coordinates and it should be unbreackable

#

how the llot tables help me

supple kettle
#

i don't know? you were the one who asked how to use the loot tables

lethal arrow
#

ahhh sorry i forgot i asked 2 questions

supple kettle
#

lol it's fine, just gets a bit confusing

lethal arrow
#

i made the loot table already\

#

so lets stick to the structure now

supple kettle
#

okay right

#

have you already made the structure? or is it part of the mod

lethal arrow
#

i already mad it and i have it as nbt

#

it is not a part of a mod

supple kettle
#

so is that saved in data/<namespace>/structures/whatever.nbt?

lethal arrow
#

no its is in saves\New World (3)\generated\minecraft\structures

supple kettle
#

well you first have to put it in the datapack so that the datapack can access it

lethal arrow
#

ok let me doi rq

#

data\strater_castle\data\starter_castle\structures

#

does this look good

supple kettle
#

yeah

#

then after this, you gotta add two more files

#

one sec

#

what's the structure NBT file called?

lethal arrow
#

castlestart

supple kettle
lethal arrow
#

oh

#

wait i will correct it

supple kettle
#

ok so then in data/starter_castle/worldgen/structure/castlestart.json, put this:json { "type": "minecraft:jigsaw", "biomes": "#minecraft:has_structure/mineshaft", "step": "surface_structures", "spawn_overrides": {}, "terrain_adaptation": "beard_thin", "start_pool": "starter_castle:castlestart", "size": 1, "start_height": { "absolute": 0 }, "project_start_to_heightmap": "WORLD_SURFACE_WG", "max_distance_from_center": 80, "use_expansion_hack": false }

and also in data/starter_castle/worldgen/template_pool/castlestart.json, put this:json { "name": "starter_castle:castlestart", "fallback": "minecraft:empty", "elements": [ { "weight": 1, "element": { "element_type": "minecraft:single_pool_element", "location": "starter_castle:castlestart", "projection": "rigid", "processors": "minecraft:empty" } } ] }

lethal arrow
#

so thsi will spawn the structure at what coordinates?

supple kettle
#

nowhere yet. but it will let you use /place structure starter_castle:castlestart

lethal arrow
#

ok just a question can i make the staructure unbreackable?

supple kettle
#

not easily

lethal arrow
#

ok can i make when you enter the structure you get mining fatigue>

supple kettle
#

in theory you can put a command block in the structure which gives nearby players mining fatigue

lethal arrow
#

good thinking

#

smart

supple kettle
#

thank u :>

lethal arrow
#

but the problem that the structure is not a circle

#

it is octagon

supple kettle
#

close enough, just find a radius which is big enough so that people nearby get mining fatigue: effect give @a[distance=..RADIUS] mining_fatigue 1 20 true (replace RADIUS with a number)

lethal arrow
#

bro i still cannot use the place

#

comand

#

wait

#

is it the command placefeature>

supple kettle
#

did you /reload and stuff

lethal arrow
#

yes i logged out and in

supple kettle
#

but did you run /reload in chat?

lethal arrow
#

yes

supple kettle
#

oki good

#

can you zip and send your datapack here so i can make sure it's all in the right place

lethal arrow
#

i also typed datapack list and the datapack is there

#

sure thing

supple kettle
#

you used world_gen instead of worldgen in data/starter_castle/

#

other than that, it all looks okay, but that's whats causing your issue

lethal arrow
#

ok wait i correct it

#

still i cant

#

use the command

supple kettle
#

what minecraft version are you using?

lethal arrow
#

1.18.2

supple kettle
#

that may be a problem considering i'm using the 1.19+ version of structures

#

it shouldn't be too hard to change it

lethal arrow
#

the pack format should be 9 right?

supple kettle
#

that doesn't matter for now

maiden lodgeBOT
#
Datapack Pack Format History

Format: 4 Versions: 17w48a–19w46b (1.13–1.14.4)
Format: 4 Versions: 17w48a–19w46b (1.13–1.14.4)
Format: 5 Versions: 1.15-pre1–1.16.2-pre3 (1.15–1.16.1)
Format: 6 Versions: 1.16.2-rc1–1.16.5 (1.16.2–1.16.5)
Format: 7 Versions: 20w46a–1.17.1 (1.17–1.17.1)
Format: 8 Versions: 21w37a–22w07a (1.18–1.18.1)
Format: 9 Versions: 1.18.2-pre1–1.18.2 (1.18.2)
Format: 10 Versions: 22w11a–1.19.3 (1.19–1.19.3)
Format: 11 Versions: 23w03a–23w05a
Format: 12 Versions: 23w06a–1.19.4 (1.19.4)
Format: 13 Versions: 23w12a–23w14a
Format: 14 Versions: 23w16a–23w17a
Format: 15 Versions: 23w18a–1.20.1 (1.20–1.20.1)
Format: 16 Versions: 23w31a–

supple kettle
#

but yes

lethal arrow
supple kettle
lethal arrow
#

ok did it

supple kettle
#

and change configured_structure_feature/castlestart.json to this:json { "type": "minecraft:village", "config": { "start_pool": "starter_castle:castlestart", "size": 1 }, "biomes": "#minecraft:has_structure/mineshaft", "adapt_noise": true, "spawn_overrides": {} }

lethal arrow
#

ok did it

supple kettle
#

then /reload, exit world then open it again, and try again

lethal arrow
#

ok

#

still can't do it

supple kettle
#

where's data/ and pack.mcmeta?

lethal arrow
#

openloader\data\strater_castle

supple kettle
#

okay TIL openloader is a thing

lethal arrow
#

what TIL?

#

what id that

supple kettle
#

today I learnt

lethal arrow
#

finally i gave you something in return

supple kettle
#

when you join the world, is there a warning like "experimental features" or something

lethal arrow
#

no

#

because i have a mod that deletes that warning

supple kettle
#

fair enough

#

hmmm

lethal arrow
#

but when i type datapack list the datapack is there

supple kettle
#

ok i'm going to load this datapack in my game

lethal arrow
#

ok sure thing

supple kettle
lethal arrow
#

i mean when i type /datapack list

supple kettle
#

no i know

lethal arrow
#

/place

#

i find /placefeature

supple kettle
#

inhales

#

/place was added in 1.19 :)

lethal arrow
#

:::::::::::::::::(

supple kettle
#

as was most things that would make this easier

#

but no worries

#

we just do a bit more work

lethal arrow
#

man you make me feel like am your ur son

supple kettle
#

lol

lethal arrow
#

you always know what to do

supple kettle
#

ok so basically what you have to do is place a structure block at 0,0 and then power the structure block. there are two problems with this though:

  1. you don't know what Y-level the surface is
  2. you don't know if 0,0 is going to be loaded/within simulation distance when you want to place the structure
#

and 3. we don't know whether 0,0 is on land, it could be in the ocean, or worse in a void world

#

to be fair, 2 and 3 are both still issues in 1.19+ but they're easier to solve

#

time to problem solve :)

lethal arrow
#

bro u sure that is free??

#

no pay?

#

cuz thank y

#

u

#

i will use a mod that will force the spawn pont to chosen cordinates

supple kettle
#
  1. you can start at y=256 and fire an arrow downwards very fast to get the surface level
  2. this isn't actually a big issue - 0,0 is usually the spawn point and therefore is usually loaded (spawn chunks are loaded). but even if they aren't, we can still place the block and the structure will be placed the next time the player loads 0,0
  3. this is still quite a big issue and I'm not sure how to solve it
#

anyway I kinda have to go sooooo <@&935561184806060073>: tldr this person wants to place a starter castle structure at world spawn in 1.18.2

lethal arrow
#

for the context the y coordintes of the structure will be also spesfic so that will not be an issue

#

it will not be a problem if i spawend a little bit higher or lower than the surface

wild patrol
#

you can setblock a structure block and activate it with a Redstone block.

lethal arrow
#

the structure should spawn automatically with no interfernce from the player

wild patrol
#

It does, if you set the Redstone block with a command too.

lethal arrow
#

ok

#

how to do that

#

i have zero knowlege of this

wild patrol
#

I'll shower and then I can explain you how to do it.

lethal arrow
#

Bro did u finish ur shower?

brisk wind
#

He really likes his showers

#

It’s the best three hours of his day

wild patrol
#

sry for the delay, something came in between.

#

do you already have the structure saved as a file?

lethal arrow
#

Yes i have

wild patrol
#

use this command setblock ~ ~ ~ structure_block[mode=load]{name:"<Structurefile Path>",rotation:"NONE",mirror:"NONE",mode:"LOAD"} to place the structure block.

#

After that command use setblock to place a redstone block one block above the structure block.

#

If you want it to spawn instantly when entering the world, you could use a tick advancement to trigger the function, that places the blocks. important is, to limit the function to only execute once.

lethal arrow
#

Ok where to put this in the datapack

#

And how to make it only once

wild patrol
#

functions go in data/<namespace>/functions/... and advancements go in data/<namespace>/advancements/...

lethal arrow
#

Ok and the structure that this function will use?

wild patrol
#

data/<namespace>/structures/...

lethal arrow
#

And infront of the setblock should be the coordinates that the block should spawn in right?

wild patrol
wild patrol
#

To make it trigger only once, you can do this for example:

load.mcfunction

scoreboard objective add internal dummy
execute unless score startStructure internal matches 1 run function <namespace>:place

place.mcfunction

setblock 0 80 0 structure_block[mode=load]{name:"<Structurefile Path>",rotation:"NONE",mirror:"NONE",mode:"LOAD"}
setblock 0 81 0 redstone_block
scoreboard players set startStructure internal 1
lethal arrow
#

So i just copy these files and put them in their places and that is it

#

Or should i do something more?

#

Other than changing the coordinates

wild patrol
#

replace <Structurefile Path> in the setblock command with your structure file path

#

that should do the trick

lethal arrow
#

Which will be in the data pack

wild patrol
lethal arrow
#

Sorry i am very bad at english

#

I mean what is the starting point of file path

wild patrol
#

the namespace

#

if you put the file in the structures folder without any subfolders, it would just be namspcace:filename

lethal arrow
#

So namespace/structure

wild patrol
#

but with a :

lethal arrow
#

Uh ok i can put where i want in the namespace

wild patrol
#

namespaces are always seperated by a : from the rest

lethal arrow
wild patrol
lethal arrow
#

Let me try this rq

wild patrol
lethal arrow
#

also the funcion json files can be any naem right

wild patrol
#

they can be any name but they are not .json files. The have .mcfunction.

lethal arrow
#

also i should not include.nbt in the structre name right

wild patrol
#

those are .json files

lethal arrow
#

i mean the structre is in.nbt

wild patrol
#

yeah

#

I just checked again

#

I remembered that wrong

lethal arrow
#

what do u mean

wild patrol
#

you were right they are .nbt files, and you don't include them in the setblock command.

lethal arrow
#

does this look right?

#

remeber i amon 1.18.2

wild patrol
#

looks ok but there were a few things not right. I fixed them rq. I also forgot to mention that you need to list the load.mcfunction file as a load function, I added that too.

#

Another thing, you can't zip the folder with the files inside. You need to zip the files inside the folder.

lethal arrow
#

I will try it now

#

nothing happens

wild patrol
#

wtf is with your structure?

#

My Minecraft crashed because of out of memory error. I have 55GB Ram for mc

supple kettle
#

lmao what

lethal arrow
#

it is a bit large

supple kettle
#

“A bit large”

wild patrol
#

max is 48x48x48

lethal arrow
#

i use a mod called structure expansion to increase that

#

i found u forgot to change the structure path in the place function

wild patrol
#

it's right

lethal arrow
#

huh?

wild patrol
#

no error

lethal arrow
#

but the structure is not there

supple kettle
#

it is otherwise it wouldn’t be underlined

wild patrol
lethal arrow
#

openloader\data\strater_castle\data\starter_castle\structures

#

this is where the structure is now

supple kettle
#

yeah, that’s correct

lethal arrow
#

in ur datapack that u sent

supple kettle
#

yep

#

so the namespace (before the colon) is starter_castle

#

then the structure is castlestart

#

so it’s starter_castle:castlestart

#

you ignore the structures folder because the game is looking for a structure anyway

#

it looks in that folder anyway

lethal arrow
#

i changed it to that

supple kettle
#

that’s wrong

#

starter_castle:castlestart is correct

lethal arrow
#

ok

#

even that the structure is not directly there?

supple kettle
#

yes

#

but it is

lethal arrow
#

no

supple kettle
#

it’s just how namespaces in Minecraft work

lethal arrow
#

i changed it now it works

#

i swear

wild patrol
#

Does the mod change more than just the structure block size?

supple kettle
lethal arrow
#

but the structure contains blocks from various mods

wild patrol
#

that's why mc crashes and vsc doesn't render

supple kettle
#

so if the structure block now works, is this question solved?

lethal arrow
#

Just give half an hour to ensure every inch of it works

lethal arrow
#

I tweaked some things in the structure i replaced them but it spawns the old structure still

#

Not asking for anything just want u to not not marked it as solved yet

wild patrol
#

if your question is answered in the future, you can resolve it too with /resolve

lethal arrow
#

K

#

it spawns them but not the strcuture now

wild patrol
#

then the delay is too short.

#

Summon a falling redstone block two blocks above instead. This should give it enough time.

#

or does the structure also not spawn if you do it manually?

lethal arrow
#

no it does no genrate the structure even if i try manually

#

because i do not have the genrated folder

wild patrol
#

then the structure is broken

lethal arrow
#

i wrote the structure path starter_castle:data:starter_castle:structures:castlestart

#

in what way?

wild patrol
lethal arrow
#

in the datapack or manually

wild patrol
#

manually first, to check if it works

lethal arrow
#

manually says is not available

wild patrol
#

idk maybe the mods are broken or they break data packs.

lethal arrow
#

but when i copy and paste the genrated folder the structure genrate normally

lethal arrow
#

even now when i change the structure path to the one u wrote before it still spawns the blocks but not the structures?

#

this is the direct folder after openloader

#

I never thought it will be this hrd

#

Hard

supple kettle
open veldt
#

theres a new thread sila '~'

supple kettle
#

but why

open veldt
#

idk im not op

lethal arrow
#

Further

lethal arrow
open veldt
#

U put a space into the string

#

a leading one

lethal arrow
#

Ok i will try and tell

open veldt
#

alsouse vscode with datapack helper plus

#

to get errors and auto complete

maiden lodgeBOT
#
Datapack Helper

While you can make datapacks using any ordinary text editor, our prefered editor of choice is VSCode!
It is aviable for Windows, Linux and MacOS (which means it runs on almost all devices) and has lots of great extensions which make the creation of datapacks a whole lot easier!

Our favourite VSCode extensions are:
language-mcfunction - Provides beautiful syntax highlighting for .mcfunction
Data-pack Helper Plus - Despite how "datapack" is spelled in the title, this adds some really helpful features like auto completion for commands!
NBT Viewer - Allows you to view 3D models of your .nbt files, directly in VSCode!
Datapack Icons - Adds cool icons to datapack folders and files

lethal arrow
#

now it works thank u,but also lets make sure so not close this thread plz

lethal arrow
#

it works fine but there is a silly issue when the structure genrates it might destroy things like dungeon chest and so on so i want the datapacks to clear all drooped items once after the structure is genrated

open veldt
#

you can do /kill @e[type=item]

lethal arrow
#

bro where should i put that in the datapack

#

should i write it in the place or load?

open veldt
#

after u spawn the structure

lethal arrow
#

like in the chat?

open veldt
#

no in place.mcfunction

lethal arrow
#

bro i copy and pasted it in place.mcfunction but it is red

open veldt
#

remove the / '~'

lethal arrow
#

ok another thing if u may i want to make the command tellraw activate the first time someone joins the world and not any more

open veldt
#

use a scoreboard

lethal arrow
#

and that would translate to what code?

open veldt
#
#############################################################################
################      load.mcfunction           #############################
#############################################################################
scoreboard objectives add joined dummy
execute if score @s joined matches 0 run function <namespace>:place

#############################################################################
###############      place.mcfunction          ##############################
#############################################################################
scoreboard players set @s joined 1
lethal arrow
#

that name space whouild be the text?

#

or that would be /tellraw @p "text" in load.mcfunction plus all the other things?

supple kettle
lethal arrow
#

but where should i write the command

supple kettle
#

if you want it to work the first time someone joins then it's a bit different

#

unless im confused

lethal arrow
#

I want a messege to be in the chat the first time someone joins the world

supple kettle
#

is load.mcfunction the one listed inside data/minecraft/tags/functions/load.json

lethal arrow
#

yes but what is the message that will apear?

supple kettle
#

the easiest way for you to send a player when they join is to create an advancement which has a tick criteria, and then the reward of the advancement would be a function which sends the message to @s

lethal arrow
#

but why not use the tellraw ?

supple kettle
#

no it does use the tellraw

#

the player will unlock the advancement just by joining the world. when the player unlocks the advancement, it runs a function. in the function is the tellraw command

lethal arrow
#

but wouldnt taht also send the player a msg that says he completed etc advancment>

supple kettle
#

no because you can turn that off

lethal arrow
#

for that specfic advancment>

#

?

supple kettle
#

if you leave out the display section of the advancement, it won't show anyway

#

its less of a "turn it off" but more "its turned on for every advancement"

#

i suppose you could say its off by default

lethal arrow
#

okay

supple kettle
#

this is the advancement, it should go in data/starter_castle/advancements/join.json: ```json
{
"criteria": {
"requirement": {
"trigger": "minecraft:tick"
}
},
"rewards": {
"function": "starter_castle:on_join"
}
}

then you need to make a function `data/starter_castle/functions/on_join.mcfunction`:```d
tellraw @s "hi"```
lethal arrow
#

but as always u know i don't know how to do that right>

#

oh u didn't even wait

open veldt
#

o f wrong one

maiden lodgeBOT
#
Datapack Folderstructure
.
├── pack.mcmeta
├── pack.png
└── data
    └── <namespace>
        ├── advancements
        ├── functions
        ├── item_modifiers
        ├── loot_tables
        ├── predicates
        ├── recipes
        ├── structures
        ├── chat_type
        ├── damage_type
        ├── tags 
        │   ├── blocks
        │   ├── entity_types
        │   ├── fluids
        │   ├── functions
        │   ├── game_events
        │   ├── items
        │   ├── chat_type
        │   └── damage_type
        ├── dimension
        ├── dimension_type
        └── worldgen
            ├── biome
            ├── configured_carver
            ├── configured_feature
            ├── density_function
            ├── noise
            ├── noise_settings
            ├── placed_feature
            ├── processor_list
            ├── structure
            ├── structure_set
            ├── template_pool
            ├── world_preset
            └── flat_level_generator_preset
        ```
supple kettle
#

you'll only need to pay attention to . ├── pack.mcmeta └── data └── starter_castle ├── advancements ├── functions └── structures

lethal arrow
supple kettle
#

yeah

lethal arrow
#

works like a charm

#

thank you again

lethal arrow
#

@supple kettle

#

bro does this look right?

#

the only thing i did was changing the msg from hi to what it is now

#

but the jigsaw does not eaven spawn nor the redstone

lethal arrow
#

@open veldt

#

@wild patrol

supple kettle
lethal arrow
#

I tried in another modpack with less mods and it worked

#

Could some mod mess with this?

cunning falcon
#

yes that can definitely be the case

#

mods can change every part of the game and most mod authors don't plan for data pack compatibility

lethal arrow
#

Ok thank i will see what i can do

lethal arrow
#

uh guys

#

i need help

#

the datapack you made is good and all but there is a slight problem

#

it does not work when i have other datapacks

#

or no

#

bro the datapack sometimes work and sometimes not

#

the text always apear but the structure does not always spawn

#

@supple kettle

#

particulery it spawns every other world