Custom Loot [Datapack]

This datapack adds the ability to add loot to entities without replacing the default loot or replacing loot from other datapacks.

 
There are two function tags for every living entity:

/data/custom_loot/tags/functions/killed/<ENTITY ID> (Don't exists for the wither and ender dragon)
/data/custom_loot/tags/functions/killed

These functions are executed as/at the entity with the given ID on death while it is living (so you can test for tags/NBT)
If no ID is given, the function gets executed as/at every living entity on death

/data/custom_loot/tags/functions/killer/<ENTITY ID> (Exists for the wither and enderdragon)
/data/custom_loot/tags/functions/killer

These functions are executed as/at the player who killed the entity with the given ID
If no ID is given, the function gets executed as/at the player who killed a living entity
(The entity killed can be checked with @e[tag=cl_dead,limit=1,sort=nearest,distance=..128] )

 

In these functions you can add commands you want to get executed when a entity is killed. 

Example:

I will demonstrate how to add two times cooked pork to Zombie Pigmen. 

First create a function and mention it in #custom_loot/killed/zombie_pigman

When only dropping a fixed amount and you don't want to use loot tables you can add the command

summon item ~ ~ ~ {Item:{id:"minecraft:cooked_porkchop",Count:2b}}

If you want to used the advanced possibilities add the following command to the function

loot drop ~ ~ ~ loot <LOOT TABLE PATH> 

Loot table example:

{
  "pools": [
    {
      "rolls": 1,
      "entries": [
        {
          "type": "item",
          "name": "minecraft:cooked_porkchop",
          "weight": 1,
          "functions": [
            {
              "function": "set_count",
              "count": {
                "min": 2,
                "max": 2
              }
            }
          ]
        }
      ]
    }
  ]
}

 

 

Before uninstalling run: 

/function custom_loot:uninstall

 

 

Changelog:
V1.2:
  • added function tag that gets executed as/at every living entity upon death
  • added function tag that gets executed as/at every player who killed a living entity
V1.1:
  • added missing tag

 

Known Bugs:

  • If you kill a entity with a weapon that deals more than 1023 damage, the custom loot system won't work (This can't be fixed)
 
If you've found any other bugs or have ideas, contact me via discord.
 
Supported entity types:
  • bat
  • blaze
  • cat
  • cave_spider
  • chicken
  • cod
  • cow
  • creeper
  • dolphin
  • donkey
  • drowned
  • elder_guardian
  • enderman
  • endermite
  • evoker
  • fox
  • ghast
  • giant
  • guardian
  • horse
  • husk
  • illusioner
  • iron_golem
  • llama
  • magma_cube
  • mooshroom
  • mule
  • ocelot
  • panda
  • parrot
  • phantom
  • pig
  • pillager
  • polar_bear
  • pufferfish
  • rabbit
  • ravager
  • salmon
  • shulker
  • silverfish
  • skeleton
  • skeleton_horse
  • slime
  • snow_golem
  • spider
  • squid
  • stray
  • trader_llama
  • tropical_fish
  • turtle
  • vex
  • villager
  • vindicator
  • wandering_trader
  • witch
  • wither_skeleton
  • wolf
  • zombie
  • zombie_horse
  • zombie_pigman
  • zombie_villager

Download

File Name Status Version Downloads Date
custom_loot-v1.2.zip R 1.14.2 +3 32 22/06/2019
Custom Loot [Datapack] 1.20.2 Updating 1.20.2 Updating Updating
Custom Loot [Datapack] 1.20.1 Updating 1.20.1 Updating Updating
Custom Loot [Datapack] 1.20 Updating 1.20 Updating Updating
Custom Loot [Datapack] 1.19.2 Updating 1.19.2 Updating Updating
Custom Loot [Datapack] 1.19.1 Updating 1.19.1 Updating Updating
Custom Loot [Datapack] 1.19 Updating 1.19 Updating Updating
Custom Loot [Datapack] 1.18 Updating 1.18 Updating Updating
Custom Loot [Datapack] 1.17.1 Updating 1.17.1 Updating Updating
Custom Loot [Datapack] Forge Updating Forge Updating Updating
Custom Loot [Datapack] Fabric Updating Fabric Updating Updating
Custom Loot [Datapack]
Custom Loot [Datapack]

Dear youtuber!
Have you a channel youtube and want to bring your Video to quality visitors?
Do you want your video to appear on our website?
Do you want to become partner with us?
Just 3 steps to become our partner:
Step 1: Make video review for mods, addons, plugins, ... which you like
Step 2: Upload this video to youtube and our link to your video description
Step 3: Send the youtube video link via message to http://fb.com/9lifehack or leave a comment in the post. We will add your video in the our post, it will help you have more view.
JOIN to get more youtube view with us!!!!

Related Posts

Smarty Productivity Happiness

9LifeHack.com - make things smart