#How do you drop something or give the player something when he kills the ender dragon?

1 messages · Page 1 of 1 (latest)

river nimbus
#

The title of this post is what I want, My datapack version is 1.20.3-1.20.4.

I tried many methods, like editing the loot table of the dragon in data/minecraft/loot_tables/entities/ender_dragon.json.

used, advancement to check if the player killed an ender dragon and give him a loot table, and even tried to use the give command to give directly to the player, but the main problem is whenever I kill the ender dragon of the end or the /summon ender_dragon the advancement don't get triggered nor it drops the loot as per data/minecraft/loot_tables/entities/ender_dragon.json

lost cobaltBOT
#

<@&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

river nimbus
#

Might be a bug

#

ask me if u want any part of my code

#

also i deleted the loot_tables/entities/ender_dragon.json but i wanted to drop a custom item

tiny junco
#
{
  "criteria": {
    "requirement": {
      "trigger": "minecraft:player_killed_entity",
      "conditions": {
        "entity": {
          "type": "minecraft:ender_dragon"
        }
      }
    }
  },
  "rewards": {
    "loot": [
      "namespace:loot_table"
    ]
  }
}
#

this is an advancement

river nimbus
#

yes

tiny junco
#

namespace:loot_table will be your loot_table

river nimbus
#

but it didnt work

tiny junco
#

?

#

i suppose entities have a "DeathLootTable" nbt

river nimbus
river nimbus
#

like

#

each tick

#

i change "DeathLootTable" nbt of ender dragon

tiny junco
#

/summon ender_dragon ~ ~ ~ {DeathLootTable:"namespace:file"}

tiny junco
#

idk about doing it every tick but

#

i think you can just do it once

#

and you should be fine

river nimbus
tiny junco
tiny junco
#

you can use that command to modify data of existing ender dragon

#

i suppose u alr know that

river nimbus
#

yes

#

@tiny junco
for testing should I kill the ender dragon from /summon cmd or the ender dragon of the original end to test the drops?

tiny junco
#

why would it matter which one

#

and unless you've been to the end then the ender dragon of the end doesn't exist

tiny junco
tiny junco
#

wont make a difference really

river nimbus
#

@tiny junco not working

#

i tried on both

tiny junco
#

whats your loot_table

river nimbus
# tiny junco whats your loot_table
{
    "pools": [
        {
            "rolls": 1,
            "entries": [
                {
                    "type": "minecraft:item",
                    "name": "minecraft:stone",
                    "functions": [
                        {
                            "function": "minecraft:set_count",
                            "count": 3,
                            "conditions": [
                                {
                                    "condition": "minecraft:random_chance",
                                    "chance": 0.35
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    ]
}

just for testing i made it stone

river nimbus
#

Oh

#

it is working

#

the loot table was wrong all this time wow

#

thk for help

lost cobaltBOT
# river nimbus it is working
🎗️ Is your question resolved?

If your question is resolved, that's great to hear! Make sure to run /resolve or click the Resolve Question button. Otherwise, feel free to continue asking for help! :D

lost cobaltBOT
#
🗑️ Recycling Thread

This thread has been inactive for some time, so I'm going to archive it.

If you're still using the thread, just send a message and it'll pop back on the thread list.