Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • Author

 

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.