Dropt

Dropt

3M Downloads

How to remove one specific item from the output from a block

Fireztonez opened this issue ยท 5 comments

commented

Hello,
I try to change the ouput from an ore top remove one of the possible drop, and we can't find how to do, by looking the explications of the mod and examples.

more exactly, I try to remove the item "nuclearcraft:gem", from the redstone ores from Geolosys (The Cinnabar, id: "geolosys:ore_vanilla:1"). I know how to remove all drop and replace, but I think it will be easier to just blacklist an item to the output chance, but, I really not understand how to set the blacklist on the json file.

Can you give me an example how to do, and possibly adding to the examples list should be great ;).

I just give you one example, but we have a lot of drop to fix using that method...

Thank's
Fireztonez

commented

I don't have time to write up an example and test it right now, but I can tell you what I would try.

Try matching against the items you want to remove and the block you want to remove them from, then use the replace if selected mode, and just put one empty item as the replacement. Keep in mind that not all mods perform block drops the way that they should. Some mods bypass the event that Dropt uses and spawn their stuff directly in the world - can't do anything about those.

commented

Ok, thank's @codetaylor, I will try to do that, thank's.

For the output, I already know I can change with Geolosys, because I have try a script for replace the output, to see if that work and only the thing specified drop, when I try to mine a complete stack, so, no issue with that.

Thank's for the idea, if I need more help, I will send my script, like that you can probably help me to fix, faster ;)

Thank's for your fast reply, really appreciated :-)
Fireztonez

commented

I tried to make a script to remove the drops in the way you told me, but I can not do it, when I do it it just removes all the drops from last. Possibly I'm doing something wrong, but I can not find a functional syntax that allows you to flip a certain output, without removing everything.

{
    "rules": [
        {
            "match": {
                "blocks": {
                    "blocks": [
                      "geolosys:ore_vanilla:1"
                    ]
                },
                "drops": {
                  "items": [
                    "nuclearcraft:gem"
                  ]
                },
                "replaceStrategy": "REPLACE_ITEMS_IF_SELECTED"
            },
            "drops": [
                {
                }
            ]
        }
    ]
}

if you can take a look at my script and tell me if you see what I'm doing wrong, that would really appreciate.

Thank's
Fireztonez

commented

So I notice three things:

  1. The items key under rules:match:drops is not correct, see IRuleMatchDrop.
  2. The replaceStrategy under rules:match is in the wrong scope (in the wrong place), see Example #1.
  3. The REPLACE_ITEMS_IF_SELECTED mode will only remove items if new drops are selected. I was wrong in my advice. Since the drops array in our case is empty, no drops are selected and no items are removed. Use REPLACE_ITEMS instead. See IRule.

I have tested with these corrections using minecraft:stone and minecraft:cobblestone and it works. I can't test with the mods you are using; I leave that to you. :)

Please let me know if these corrections work for you, thanks.

commented

Thank you very much for your help, my script is done and it work perfectly now.

If you want, you can add this script to your examples, it can possibly help some people...

So here complete script for remove somes drops from a list of ores:

{
    "rules": [
        {
            "match": {
                "blocks": {
                    "blocks": [
                        "geolosys:ore_vanilla:0",
                        "geolosys:ore_vanilla:1",
                        "geolosys:ore_vanilla:3",
                        "geolosys:ore_vanilla:4",
                        "geolosys:ore_vanilla:5",
                        "geolosys:ore_vanilla:6"
                    ]
                },
                "drops": {
                    "drops": [
                        "nuclearcraft:gem:*",
                        "nuclearcraft:dust:*"
                    ]
                }
            },
            "replaceStrategy": "REPLACE_ITEMS",
            "drops": [
                {

                }
            ]
        }
    ]
}

So tank you again
Fireztonez