#Help me save the dolphins from extinction

1 messages · Page 1 of 1 (latest)

random ocean
#

I'm trying to create a lightweight way to give any new dolphin spawns permanent waterbreathing in 1.20.4. The way I tried to go was that it's not checking every tick for non-waterbreathing dolphins. Where did I go wrong?

split bloomBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 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

#
Result of analysis

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.json uses incorrect syntax
odd isle
#

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

random ocean
#

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

long badge
long badge
#

Pretty much any datapack tutorials should cover this, if you need to learn.

mellow otterBOT
#
📂 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
                        ```
random ocean
#
tag @e[type=dolphin] add water_breathing```

that's what it is trying to run
random ocean
long badge
#

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.

random ocean
#

@e means nothing?

#

should I just scrap the tag and have it apply to all dolphins?

#

reapply

#

nope

long badge
#

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.

random ocean
#

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

odd isle
ionic bear
#

And on the function file that you ran rn add

tag add @s water_breathing ```
ionic bear