Jump to content

[Resolved] [1.16.5] Global Loot Modifier - Unexpected result


Nuke3d

Recommended Posts

Some time ago I used the GLM system to modify drops for several mobs, chests, etc. It all seemed to work well and I have since moved on to other parts of my mod. Yesterday I noticed that when a villager harvested some wheat, it was adding some of my drops. I did not do any harvest drops, yet there it was. In looking closer, it looks like the loot table ID is "minecraft:blocks/wheat", which I expected. The GLM that is being matches is my villager GLM:

{
  "type": "nukesecon:addcoins",
  "conditions":
  [
    {
      "condition": "minecraft:entity_properties",
      "predicate": {
        "type": "minecraft:villager"
      },
      "entity": "this"
    }
  ],
  "numRolls": 5,
  "woodChance": 10,
  "ironChance": 1,
  "copperChance": 0.1,
  "goldChance": 0.001,
  "diamondChance": 0,
  "emeraldChance": 0
}

 

This was meant to drop items should you kill a villager, and not modify the loot table should the villager harvest a block. I think this was just an unexpected consequence and I'm going to have to modify my GLMs to handle the fact that when an entity such as a villager acts on a block, such as harvesting wheat, this will match the condition/predicate. Anyway, I just thought I would ask the forum for advice on the best way to accomplish all this before I go too much further. Essentially, the goal is to drop coins when you kill mobs. The coins can also appear in chests and whatnot. Full source can be found here if interested: https://github.com/nuke3d/NukesEcon

Thanks you!

Edited by Nuke3d
Link to comment
Share on other sites

 

58 minutes ago, diesieben07 said:

You just need to add a damage_source_properties condition as well. No need to specify any properties for the condition, but it will verify that there is a damage source in the loot context, meaning the looting was the result of something killing a villager.

Thank you! I will give it a shot. Money was never supposed to grow on trees like this. =p

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.