Looter

Looter

833 Downloads

This datapack has been discontinued.

This data pack is a utility, to be used by other data packs; it does nothing tangible on its own.

The main function of this data pack is to allow loot to be added to entities without replacing MC loot tables, thus avoiding conflict with other data packs that add loot to the same entities.

To add loot to an entity type using Looter, add the desired function to the function tag of the same name as the entity type, in the name space "looter" (e.g. to have a function run every time a bat is killed, add the function to the tag "#looter:bat"). The tagged function will run as, and at, the entity that was just killed. It is recommended that you use loot tables you create within your own namespace, and use the loot function added in 1.14 to spawn the items in. All conditions and functions of loot tables operate normally in this scenario (e.g. the player kill condition will correctly detect whether the entity was killed by the player, etc.).

Note that Looter does not differentiate between different entity sub-types (e.g. cat colours), but you can do so with the aforementioned custom loot tables, or within the tagged function itself, since it will be running as the recently deceased entity.

If you've made a data pack, and want to exclude a custom mob (that uses a regular mob as the underlying entity; e.g. an invisible zombie wearing enchanted chain mail armor to make a ghost) you've made from being affected by Looter, you can make Looter ignore it by adding the scoreboard tag "looter.exclude" to your custom mob. Looter also ignores Invulnerable entities, and entities with No AI.

If you have any questions, or would like help utilising this data pack utility with your own data pack, feel free to leave a comment or message me directly, and I'll be happy to help! Some examples of the use of Looter can be found in the 1.14+ versions of my other data packs; Dreamcatcher, and Flight Beacons.

Known Bugs:

  • The method Looter uses to detect kills causes loot tables that are spawned via Looter functionality to ignore Looting enchantments and Luck effects.
  • If Looter is unstalled, all mobs will no longer die when they've taken the usual amount of damage, but will instead take a lot more hits to kill. This issue is magnified with boss mobs.

More information about data packs and how to use them can be found on the official Minecraft Wiki.