#structure that spawns only once and in specfic coordinates
1 messages · Page 1 of 1 (latest)
use the /place structure command
/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.)
you might want to use /execute over to make it spawn on land
sorry but i do not understand anything about datapacks is there is a tutorial for the basic?
Working in 1.19, 1.18, 1.17 and 1.16! Learn how to make a datapack in minecraft 1.19 with my hot new datapack tutorial! I only cover functions in this tutorial because I think that's the most useful feature of datapacks. Leave a comment if you have questions!
===Important Links!===
Visual Studio Code: [ http://code.visualstudio.com/ ]
Datapack ...
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
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
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?
that should work, and yeah just put them in a new datapack
change the set_count Count field to 0. That would probably be the easiest way to do it.
ok thank you
bro i changed it now it works well now i want to make a certain items drop from certain mobs
how to do that
u can use a loot table generator
its so much easier
like this one: https://misode.github.io/loot-table/
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
can i call u?>
no
yes
We cover the basics and some advanced uses of loot tables :)
📦 Starter Datapack: https://www.dropbox.com/s/l8vqplyw2d21fet/starter_pack.zip?dl=1
📝New Challenge:
Medium ➡️ Recreate some functionality of loot tables with commands
⚔️ Server IP: cloudgames.ml
🔵 Discord Server: https://discord.gg/HyZPCTu
💻 Website: https://dtdeadpool.wixsite.com/cl...
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
ignore ethe bits about javascript because that's irrelevant here
(replying to ^^)
so what is the answer to my question>
you said that the syntax is weird and what does all the brackets mean so i sent you a guide to JSON syntax
uhhh
anyway, did you see this?
yes i mad a loot
it generates the json for you
which mob?
modded one
bro what i meant it looke wierd is what should i write in these brackets
okay, to repeat what I just said, if you don't know how to write JSON, then use the loot table generator: https://misode.github.io/loot-table/
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
i don't know? you were the one who asked how to use the loot tables
ahhh sorry i forgot i asked 2 questions
lol it's fine, just gets a bit confusing
so is that saved in data/<namespace>/structures/whatever.nbt?
no its is in saves\New World (3)\generated\minecraft\structures
well you first have to put it in the datapack so that the datapack can access it
in here ^^^
ok let me doi rq
data\strater_castle\data\starter_castle\structures
does this look good
yeah
then after this, you gotta add two more files
one sec
what's the structure NBT file called?
castlestart
btw you misspelled starter_castle (after data/)
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" } } ] }
so thsi will spawn the structure at what coordinates?
nowhere yet. but it will let you use /place structure starter_castle:castlestart
ok just a question can i make the staructure unbreackable?
not easily
ok can i make when you enter the structure you get mining fatigue>
in theory you can put a command block in the structure which gives nearby players mining fatigue
thank u :>
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)
did you /reload and stuff
yes i logged out and in
but did you run /reload in chat?
yes
oki good
can you zip and send your datapack here so i can make sure it's all in the right place
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
what minecraft version are you using?
1.18.2
that may be a problem considering i'm using the 1.19+ version of structures
it shouldn't be too hard to change it
the pack format should be 9 right?
that doesn't matter for now
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–
but yes
but i am brainddead in commands
nah don't worry. Just rename the folder structure (in worldgen) to configured_structure_feature
ok did it
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": {} }
ok did it
then /reload, exit world then open it again, and try again
where's data/ and pack.mcmeta?
okay TIL openloader is a thing
today I learnt
finally i gave you something in return
when you join the world, is there a warning like "experimental features" or something
but when i type datapack list the datapack is there
ok i'm going to load this datapack in my game
ok sure thing
what place command are you using btw
i mean when i type /datapack list
no i know
:::::::::::::::::(
as was most things that would make this easier
but no worries
we just do a bit more work
man you make me feel like am your ur son
lol
you always know what to do
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:
- you don't know what Y-level the surface is
- 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 :)
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
- you can start at y=256 and fire an arrow downwards very fast to get the surface level
- 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
- 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
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
you can setblock a structure block and activate it with a Redstone block.
the structure should spawn automatically with no interfernce from the player
It does, if you set the Redstone block with a command too.
I'll shower and then I can explain you how to do it.
Bro did u finish ur shower?
sry for the delay, something came in between.
do you already have the structure saved as a file?
Yes i have
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.
functions go in data/<namespace>/functions/... and advancements go in data/<namespace>/advancements/...
Ok and the structure that this function will use?
data/<namespace>/structures/...
And infront of the setblock should be the coordinates that the block should spawn in right?
replace the ~ ~ ~ with your coordinates
btw, forget the advancement
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
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
replace <Structurefile Path> in the setblock command with your structure file path
that should do the trick
which what?
the namespace
if you put the file in the structures folder without any subfolders, it would just be namspcace:filename
So namespace/structure
Uh ok i can put where i want in the namespace
namespaces are always seperated by a : from the rest
Instead of the slash
yes
Let me try this rq
<namespace>:structures/<filename>
also the funcion json files can be any naem right
they can be any name but they are not .json files. The have .mcfunction.
also i should not include.nbt in the structre name right
those are .json files
i mean the structre is in.nbt
what do u mean
you were right they are .nbt files, and you don't include them in the setblock command.
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.
wtf is with your structure?
My Minecraft crashed because of out of memory error. I have 55GB Ram for mc
lmao what
it is a bit large
“A bit large”
max is 48x48x48
i use a mod called structure expansion to increase that
i found u forgot to change the structure path in the place function
huh?
no error
but the structure is not there
it is otherwise it wouldn’t be underlined
openloader\data\strater_castle\data\starter_castle\structures
this is where the structure is now
yeah, that’s correct
in ur datapack that u sent
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
no
it’s just how namespaces in Minecraft work
Does the mod change more than just the structure block size?
seems unlikely, because that’s not how Minecraft works at all
no
but the structure contains blocks from various mods
that's why mc crashes and vsc doesn't render
so if the structure block now works, is this question solved?
Just give half an hour to ensure every inch of it works
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
if your question is answered in the future, you can resolve it too with /resolve
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?
no it does no genrate the structure even if i try manually
because i do not have the genrated folder
then the structure is broken
i wrote the structure path starter_castle:data:starter_castle:structures:castlestart
in what way?
try only this starter_castle:structures
in the datapack or manually
manually first, to check if it works
manually says is not available
idk maybe the mods are broken or they break data packs.
but when i copy and paste the genrated folder the structure genrate normally
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
does starter_castle:castlestart work?
but why
idk im not op
Because I thought you got sick of me so i wanted not to push firther
Further
No i tried every way to right write the comman but it says not available unless i copy the genrated folder from my main world
Ok i will try and tell
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
now it works thank u,but also lets make sure so not close this thread plz
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
you can do /kill @e[type=item]
bro where should i put that in the datapack
should i write it in the place or load?
after u spawn the structure
like in the chat?
no in place.mcfunction
bro i copy and pasted it in place.mcfunction but it is red
remove the / '~'
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
use a scoreboard
and that would translate to what code?
#############################################################################
################ 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
that name space whouild be the text?
or that would be /tellraw @p "text" in load.mcfunction plus all the other things?
no, the namespace would be starter_castle. basically, the folder after data
but where should i write the command
if you want it to work the first time someone joins then it's a bit different
unless im confused
I want a messege to be in the chat the first time someone joins the world
is load.mcfunction the one listed inside data/minecraft/tags/functions/load.json
yes but what is the message that will apear?
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
but why not use the tellraw ?
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
but wouldnt taht also send the player a msg that says he completed etc advancment>
no because you can turn that off
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
okay
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"```
o f wrong one
.
├── 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
```
you'll only need to pay attention to . ├── pack.mcmeta └── data └── starter_castle ├── advancements ├── functions └── structures
does this look right?
yeah
@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
if it doesn’t spawn then it’s probably not right
I tried in another modpack with less mods and it worked
Could some mod mess with this?
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
Ok thank i will see what i can do
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