Help with loot table functions

Started by ShadowzWalker on

Topic category: Help with MCreator software

Last seen on 02:46, 24. Nov 2023
Joined Jan 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Help with loot table functions
Thu, 03/26/2020 - 18:03 (edited)

I tried to add functions to the custom loot table json (chest)

 

I took a look at the vanilla loot tables and tried to add:

  1. min and max stack size (count)
  2. entchanted gear and books

 

The problem is that after I added  the specific section in the code the loot table stopped working. Everything worked fine before I changed the json file. Did I do something wrong? (edited json part down below)

Would be glad if someone knows the answer aka. my problem.


Function-count:

        {
          "type": "minecraft:item",
          "weight": 100
          "functions": [
            {
              "function": "minecraft:set_count",
              "count": {
                "min": 1,
                "max": 3
              }
            }
          ],
          "name": "minecraft:cobblestone",          
        },

 

Function-Enchantments:

        {
          "type": "minecraft:item",
          "functions": [
            {
              "function": "minecraft:enchant_with_levels",
              "levels": 30,
              "treasure": true
            }
          ],
          "name": "minecraft:book"
        },

 

Edited by ShadowzWalker on Thu, 03/26/2020 - 18:03
Last seen on 21:23, 6. Nov 2022
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hi there @ShadowzWalker, I…
Fri, 05/15/2020 - 03:33

Hi there @ShadowzWalker, I've actually been trying to figure this out myself. I'm not much of a coder but I would like to see those two options available.

I'm currently working on a mod that edits the vanilla loot tables and adds my own stuff in them, but I read that a) mod loot tables override vanilla loot (kinda bad in my case) b) vanilla loot uses staked items and enchanted items (can't mod unless you use code)

Since your post was the only post I found that talks about this topic, maybe If we can get enough people to talk about this, the developers could add these options in a later update.

 

I'll look into coding to see if I could help you out, but If you find out a solution before me could you let me know. Thank you and thanks for posting!

Last seen on 21:23, 6. Nov 2022
Joined Nov 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Oh, and another thing I'm…
Fri, 05/15/2020 - 03:47

Oh, and another thing I'm looking into is Item durability in loot tables, I'll let you know If I fin out how to do that as well.