#Help me save the dolphins from extinction
1 messages · Page 1 of 1 (latest)
<@&1201956957406109788>
💬 While you wait, take this time to provide more context and details.
🙇 After a while, hit the Summon Helpers button to ping the helper team. They'll be happy to help you
✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve
I found 4 issues with the structure of your datapack.
- I couldn't find
pack.mcmeta. Make sure that it exists in the root of the zip. - I couldn't find the folder
data. Make sure that it exists in the root of the zip. - I couldn't find the namespace
minecraft. It isn't required, but 90% of datpacks do need to have it. If you don't use tick/load functions or you don't need to change vanilla data, then disregard this. - The JSON file at path
SaveTheDolphins/data/minecraft/functions/dolphins/waterbreathing.jsonuses incorrect syntax
I'm not going to download and crawl around in your data pack. Please paste the contents of the relevant functions
Also this minecraft:dolphins/waterbreathing function appears to be a .json file when it should be .mcfunction
honestly that analysis result gave me more questions
the pack.mcmeta is there, so is data, and maybe I'm misinterpreting namespace but there is a folder called minecraft.
pack.mcmeta is
{
"pack": {
"pack_format": 26,
"description": "Tutorial Data Pack"
}
}
I deleted the json, it was empty and I forgot to delete it when I realized it has to be an mcfunction
effect give @e[type=dolphin] minecraft:water_breathing 1 1 true
in the apply_water_breathing
The validation error was because you zipped your pack incorrectly. Typically you want to zip the pack so it’s contents are in the root of the zip, instead of in a folder.
The reason the pack isn’t working is because you are missing the json files that tell Minecraft which of your mcfunction files is the one that should run every tick.
Pretty much any datapack tutorials should cover this, if you need to learn.
.
├── 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
```
I tried to set it up so it only triggers when a dolphin spawns. I am trying to avoid running something every tick.
"criteria": {
"dolphin_spawned": {
"trigger": "minecraft:entity_spawned",
"conditions": {
"entity": "minecraft:dolphin"
}
}
},
"rewards": {
"function": "dolphins:grant_waterbreathing"
}
}```
tag @e[type=dolphin] add water_breathing```
that's what it is trying to run
I rezipped and here's the whole thing. Thanks.
So, whenever the funciton runs, it gives all dolphins without the tag water_breathing, water breathing, then it gives ALL dolphins the tag water_breathing.
My guess is that one dolphin gets water breathing, but then all others get the tag, so they can't get the effect.
@e means nothing?
should I just scrap the tag and have it apply to all dolphins?
reapply
nope
Why are you executing as all dolphins and then giving the effect to all dolphins?
You don't need the execute as @e[type=dolphin,tag=water_breathing] at @s run part, just having the effect command will work, and will be less taxing on performance.
well if they other dolphins are getting the tag but not the water breathing then having the one that actually got waterbreathing just give it to every other dolphin in a 16 block radius then that should fix it
still doesn't work and I'm missing something else but yeah
So that I understand, do you think that this advancement will trigger every time a dolphin naturally spawns?
Make a tick.mcfunction and Put
execute as @e [type="dolphin ",tag=!water_breathing] run function whatever the name is
And on the function file that you ran rn add
tag add @s water_breathing ```
It take much performance cause the amount of dolphin spawing won't be that high also this is way better than what you were doing before