Dropt

Dropt

3M Downloads

Blocks without rules or matching rules don't drop XP

Fireztonez opened this issue ยท 9 comments

commented

Hello,
I add your mod to my modpack to have total control over what the ores and blocks drop when mining. Your mod seems really very powerful and well done, but what I do not like is that as soon as it completely removes the XP drop when you mine coal, diamand or quartz for example. I would like to have a quick and easy way to reactivate the XP drop, without having to redo the drops of all blocks, if I find them correct. Of course, we must keep the possibility of override these values.

Fireztonez

commented

By default, Dropt does not modify the XP dropped from blocks.

https://github.com/codetaylor/dropt/blob/master/SYNTAX.md#iruledrop

If you are experiencing something different, I need more information.

Please provide a LINK to the Dropt .json configuration file that is demonstrating the unwanted behavior.

commented

Also, please tell me what version of Dropt are you using?

commented

Sorry, I forget to give the version of the mod, my bad!

Minecraft: 1.12.2
Dropt: 1.8.1
Forge: 14.23.2.2629

I try mining without any JSON and I get no XP at all...
I make a json to fix that issue for the quartz, but I can't find a way to just set the XP, and doesn't touch to he item drop, so I had to redo the item drop too... This is little anoying, but possibly I make something wrong, I'm not a big programmer :(...

Here the JSON I make for fix the XP issue (But now, only the Quartz works, the rest is not fixed yet):
https://gist.github.com/Fireztonez/fb85c7ceb662e42f88ec83ee3455737d

Fireztonez

commented

The other thing I whan't to know, it's in relation to fortune's enchantment, I wondered if there was a way to make that amount received varies, as in Minecraft Vanilla?
When I Try with my script, I always got the same amount of quartz...

commented

Ok, so I got a bug!
I was wondering if this was the expected result of the mod, but I'm happy to see that it was only a bug: D

commented

Fix available in 1.12.2-1.8.2

commented

Thank's for your fast reply and fix!
Fireztonez

commented

@Fireztonez

{
  "rules": [
    {
      "match": {
        "blocks": {
          "blocks": [
            "minecraft:quartz_ore"
          ]
        }
      },
      "drops": [
        {
          "item": {
            "items": [
              "minecraft:quartz"
            ],
            "quantity": {
              "min": 1,
              "max": 2
            }
          }
        },
        {
          "selector": {
            "weight": {
              "value": 10
            },
            "fortuneLevelRequired": 1
          },
          "item": {
            "items": [
              "minecraft:quartz"
            ],
            "quantity": {
              "min": 4,
              "max": 8
            }
          }
        },
        {
          "selector": {
            "weight": {
              "value": 100
            },
            "fortuneLevelRequired": 2
          },
          "item": {
            "items": [
              "minecraft:quartz"
            ],
            "quantity": {
              "min": 16,
              "max": 32
            }
          }
        },
        {
          "selector": {
            "weight": {
              "value": 1000
            },
            "fortuneLevelRequired": 3
          },
          "item": {
            "items": [
              "minecraft:quartz"
            ],
            "quantity": {
              "min": 32,
              "max": 64
            }
          }
        }
      ]
    }
  ]
}

Varying the fortune is a little tricky. Let me explain what the script above is doing.

First, it adds four drops to the drop pool, of which only one will be selected to drop.

The first drop at the top of the list adds a drop that varies between 1 - 2 drops and has a weight of 1. This drop will always be added to the drop pool.

The next drop, the one right below it, adds a drop that varies between 4 - 8 drops, but requires a minimum fortune level of 1 to be added to the drop pool. It has a weight of 10 meaning that if added to the pool, it is about 10 times more likely to get chosen than the first drop added, the one with no selection rules and a weight of 1.

The next drop varies between 16 - 32 drops and has a minimum fortune level of 2 and a weight of 100. This drop is about 10 times more likely to be chosen than the Fortune I drop and about 100 times more likely to be chosen than the No Fortune drop. This drop will only be added to the pool if the player has Fortune II or greater.

Finally, the last drop added varies between 32 - 64 and has a minimum fortune level of 3 and a weight of 1000. This drop is about 10 times more likely to be chosen than the Fortune II drop. This drop will only be added to the pool if the player has Fortune III.

What this does is create a drop pool that scales up as the player increases fortune, but allows you to configure each tier with a random range of drop quantity.

Now keep in mind, that while it is unlikely, it is possible that a player with Fortune III could mine a block and get very unlucky by having the first drop rule selected. However, with the example above, that would be a 1 in 1111 chance of happening.

I hope this helps you to better understand how it all works. :)

commented

@codetaylor

Thanks a lot for this explanation, that's exactly what I was looking for, probably not with the same numbers, but the same type of management I need !! This will be really useful for my modpack, because I'm going to have to create several ores (with Content Tweaker), and Content Tweaker is realy limiting about the config of the drop...