Magic

Magic

190k Downloads

Drop Rule Exploit (?)

NightScythe1 opened this issue ยท 5 comments

commented

Working on making custom drops-
I'm trying to replace emerald ore's drop with my own custom drop 'Mystite' with this in a World config-

  block_break:
    mystite_ore:
      class: Drop
      types:
        - emerald_ore
        - deepslate_emerald_ore
      items:
        mystite: 1

It works, however-
A) I'm unsure how to 'replace' the drop- I can only add the Mystite drop, but it still drops an emerald.
B) There's a duplication exploit here- Players can use Silk Touch on the Ore and simply keep replacing it over and over again to get the added drop. Unless I'm missing a tag to prevent this?

commented

I was just about to "fix" this but oops I think there's support for what you want to do already.

Try adding result: remove_drops

If that works, please let me know and I'll revert the change I just made!

EDIT, to be clear, like this:

 block_break:
    mystite_ore:
      class: Drop
      result: remove_drops
      types:
        - emerald_ore
        - deepslate_emerald_ore
      items:
        mystite: 1
commented

"result: remove_drops" worked a charm, thank you!! it now drops the Mystite even if silk touch is used, and doesn't drop emerald ore, is that intended? (it works for me either way!)

commented

Are there other flags that can be used for the Drop Rule? Such as "amount" for dropping multiple, or dependant on Fortune such as "amount: rand(1,fortune+1)" or such...? I haven't been able to find much info on it so far

commented

I love that idea, but sadly no. I think it's doable but not easily, like not via the normal way of config processing since these rules only get parsed once, not in the context of the player (how you'd normally get attributes and enchants).

EDIT: And yeah silk touch shouldn't matter if you're replacing the drops

commented

ahh okay that makes sense, well- thanks for the info!