[MECH] OtherDrops 2.8- Ultimate block/mob/player drop editing [1.5.2]

Discussion in 'Archived: Plugin Releases' started by Zarius, Jun 12, 2011.

  1. Offline

    Zarius

    [​IMG]


    Want to fix glass/stairs/boat drops? Want to gather ice/glowstone/grass in a balanced manner? Want to smelt ore with golden tools? Want to cause chaos with undead that rise again? Now you can, simply by enabling the included example files or delve into the more advanced customisation and make drops work the way you want.

    OtherBlocks aims to give you ultimate control over what item that blocks/entities drop when destroyed, depending on how they were destroyed. Compatible with WorldGuard. Lightweight! Only scans what it needs to and ignores the rest.
    Download: BukkitDev (download link on there) | Source Code

    Included Modules
    * Fix undroppables: fix drops for stairs, glass (don't use your hands - ouch), boats & bookshelves (1.8 stairs included)
    * Gold tools (basic): gold tools have a chance of dropping the complete block for grass, ice & glowstone.
    * Gold tools (smelt): gold tools have a chance of mining an ingot directly from ores.
    * Ore Extraction: using the usual tools, ingots are ripped out of ores, leaving the stone behind.
    * Leaf overhaul: adds leaf drops (apples, cocoa, leaves, sticks & a very small chance of golden apple).
    * Undead Chaos: beware the night! Zombies & skeletons rise again and even players rise back from the dead (player deaths spawn more zombies/skeletons).
    * and more...

    Custom Configuration Examples
    Code:
        # Simple glass drop fix
        GLASS:
          - drop: GLASS
     
        # Players drop Zombies on death, 50% of the time
        PLAYER:
          - drop: CREATURE_ZOMBIE
            chance: 50%
     
        # Spiders killed with any sword at night have a 10% chance to drop web,
        # otherwise they drop whatever they normally would
        CREATURE_SPIDER:
          - tool: ANY_SWORD
            time: NIGHT
            drop: WEB
            chance: 10%
     
        # Trees drop apples (or cocoa from birch trees)
        SPECIAL_LEAFDECAY@GENERIC:
          - drop: APPLE
            chance: 5%
        SPECIAL_LEAFDECAY@BIRCH:
          - drop: DYE@BROWN
            chance: 5%
    
    If you are getting errors with the word "snakeyaml" in it, your config file isn't properly formatted.
    Test it on this website (or this one).

    See the dev.bukkit page for full details on how to set up OtherDrops, a complete parameters list and further examples.


    Changelog

    Newest changelog details here.


    Main author: @Zarius
    Contributors: @Celtic Minstrel, raws
    Original author: @cyklo
     
  2. Offline

    Celtic Minstrel

    @Raycrash – Yes.

    If you're not using MONEY@5 but are instead using quantity: 5, you shouldn't need to change anything... can I see your config? Does %q work on some drops and fail on others? If so, can you mark in you config the drops on which it works? (Or the ones on which it doesn't work; either is good.)
     
  3. Offline

    Raycrash

    Well it seems the drop chance is much higher than 5% so is there maybe a bug ?
    2 b6

    Edit: tested now with beta7
    It seems that the normal drop won't be cleared.
    So there is the normal dropchance + another 5% :(
     
  4. Offline

    Malaras

    CB 1240 OD beta 7
    Money Error
    Code:
    2011-10-08 02:42:11 [INFO] [OtherDrops:2.0-beta7] Events node created.
    
    2011-10-08 02:42:11 [INFO] [OtherDrops:2.0-beta7] Loading file: otherdrops-drops.yml
    
    2011-10-08 02:42:11 [WARNING] [OtherDrops:2.0-beta7] Invalid data for MONEY: 0
    
    2011-10-08 02:42:11 [WARNING] [OtherDrops:2.0-beta7] Invalid data for MONEY: 0
    
    2011-10-08 02:42:11 [WARNING] [OtherDrops:2.0-beta7] Invalid data for MONEY: 0
    
    2011-10-08 02:42:11 [WARNING] [OtherDrops:2.0-beta7] Invalid data for MONEY: 0
    
    2011-10-08 02:42:11 [INFO] [OtherDrops:2.0-beta7] Using Bukkit superperms.
    
    2011-10-08 02:42:11 [INFO] [OtherDrops:2.0-beta7] OtherDrops loaded.
    
    2011-10-08 02:42:11 [INFO] [OtherDrops:2.0-beta7] Payment method found (iConomy
    
    Money Config
    Where i had Money in when it was working correctly. in beta 6. went to beta 7 and stoped working.
    Also %q was working here just had decimals...Which read a post about how to stop it from doing that but not sure where/what to put to get it to round to nearest 1$

    Code:
    otherdrops:
      CREATURE_CHICKEN:
        - drop: {FEATHER/30%, RAW_CHICKEN/25%}
        # Don't need the air drop
    
      CREATURE_COW:
        - drop: {LEATHER/25%, RAW_BEEF/10%}
    
      CREATURE_PIG:
        - drop: {RAW_PORKCHOP/25%}
    
      CREATURE_SHEEP:
        - drop: {WOOL/25%, DIRT/5%}
    
      CREATURE_CREEPER:
        - drop: MONEY
          quantity: 1-5
          message: You recive %q dollars from a Creeper.
    
      CREATURE_SPIDER:
        - drop: MONEY
          quantity: 1-5
          message: You recive %q dollars from a Spider.
    
      CREATURE_ZOMBIE:
        - drop: MONEY
          quantity: 1-5
          message: You recive %q dollars from a Zombie.
    
      CREATURE_SKELETON:
        - drop: MONEY
          quantity: 1-5
          message: You recive %q dollars from a Skeleton.
    
    
    Took money out because wasnt working correctly, but added some items but %q not working correctly.
    Also with skeleton i noticed its still droping bones?
    Only that once i noticed that the %q was correct and was at first then it went bad.
    None of the %q 's work either false amounts or does nothing at all.

    Code:
     otherdrops:
      CREATURE_CHICKEN:
        - drop: {FEATHER/30%, RAW_CHICKEN/25%}
        # Don't need the air drop
    
      CREATURE_COW:
        - drop: {LEATHER/25%, RAW_BEEF/10%}
    
      CREATURE_PIG:
        - drop: PORK
          chance: 25%
          quantity: 1
          message: You recive %q Porkchop from a Pig.
    
      CREATURE_SHEEP:
        - drop: {WOOL/25%, DIRT/5%}
    
      CREATURE_CREEPER:
        - drop: SULPHUR
          chance: 10%
          quantity: 1-2
          message: You recive %q Sulphur(s) from a Creeper.
    
      CREATURE_SPIDER:
        - drop: STRING
          chance: 50%
          quantity: 1-2
          message: You recive %q String from a Spider.
        - drop: WEB
          chance: 5%
          quantity: 1
          message: You recive %q Web from a Spider.
    
      CREATURE_ZOMBIE:
        - drop: ROTTEN_FLESH
          chance: 50%
          quantity: 1-2
          message: You recive %q Flesh from a Zombie.
    
      CREATURE_SKELETON:
        - drop: ARROW
          chance: 30%
          quantity: 1-3
          message: You recive %q Arrow(s) from a Skeleton.
        - drop: BOW
          chance: 5%
          quantity: 1
          message: You recive %q Bow from a Skeleton.
    
     
  5. Offline

    Celtic Minstrel

    Ah, right. Try this:
    Code:
        SLIME@TINY:
        - drop: NOTHING
        - drop: 341
          chance: 5%
    
    Hm. Actually, that's interesting, because it says "invalid data 0". Maybe I accidentally broke money altogether.

    In otherdrops-config.yml, add the line "money-precision: 0" to round to the nearest whole number. Your money config looks correct, so it must be an issue on my end. Feel free to revert to beta6 if it works better. :)

    You keep not answering my questions on the %q issue. I can't do anything if you just tell me "it went bad"; I need to know how it "went bad". Reload OtherDrops (odr at the console or /odr in-game), then try killing a few pigs (like, six or seven). Tell me for each one how many porkchops you got and how many porkchops the message said you got. Repeat the process with another mob (just two mobs should be fine), killing a few and letting me know what quantity you get and what quantity the message says you get. NOTE: The step of reloading OtherDrops first is important, since the issue could be something that is related to the number of times the drop has occurred since OtherDrops loaded.

    Basically, I need a detailed report to determine what the issue is.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  6. Offline

    Malaras

    Spider #1 nothing
    zombie #1 2 flesh, 0 flesh from zombie
    skeleton #1 1 arrow 1bone, no message
    skeletom #2 1 bone, no message
    spider #2 1 string, o string from spider
    zombie #2 1 flesh, no message
    skeleton # 3 3 arrow, 0 arrow from a skeleton
    zombie # 3 1 flesh, no message

    i cant seem to kill creepers they always blow up b4 i can
     
  7. Offline

    Celtic Minstrel

    Hm... the "no message" ones are likely default drops. I'll look at the code and see if I can find any clues.

    By the way, the best way to kill creepers before they blow up is to use a bow. ;)
     
  8. Offline

    Malaras

    Have you looked into the money thing yet?
    also with the Drop: NOTHING 1st...Will that over right default drops?

    Thanks,
     
  9. Offline

    Celtic Minstrel

    drop: NOTHING will override default drops even if it is not first. It won't ever override drops that you've specified.

    I haven't looked into the money thing, but I suspect it'll be a simple fix.
     
  10. Offline

    RugRats

    @Zarius and @Celtic Minstrel
    Celtic, I stopped using otherdrops beta 7 because there are many errors, them being the ones posted above. Some I should probably post. But please do you're best to fix them :D,
    Zarius, hawktool can't log thin-glass, glass or glowstone because of this :O (I'm sure there's other's.) Please fix. Also i'm on beta 6.
     
  11. Offline

    Raycrash

    Thanks it worked now slimeballs are super rare on our server :)
    This is nice because there need to be some things which shouldnt be easy to get :p
     
  12. Offline

    GECLAN Erik

    Since the included od-stop_mob_farms.yml dont work, what is the best way to prevent mob farms?

    Also i made this one:
    Code:
        CREATURE_ZOMBIE:
            - tool: PLAYER
            - dropspread: TRUE
            - drop: DEFAULT
    
            - drop: MONEY
              quantity: 1-10
              message: Dropped %q &adollars.
    
    
    How do i prevent it from dropping insane decimals like. "Monster dropped 2.64564564564645 dollars"
     
  13. Offline

    Malaras

    7 post's up. ;)
     
  14. Offline

    Celtic Minstrel

    Or change it from 0 to 2 for the normal two decimal places.

    Naturally I'll do my best to fix them, but please do post the errors or PM me; I can't fix what I'm not aware of. ;)
     
  15. Offline

    Cruxsky

    this isnt working
    CREATURE_CREEPER:
    - drop: CREATURE_CREEPER
    trollface?
     
  16. Offline

    Addicust

    I love this plugin it is great for every server.
     
  17. Offline

    Celtic Minstrel

    That doesn't give me any sort of info I might need to be able to ascertain the issue and (potentially) fix it.
     
  18. Offline

    Cruxsky

    im doing this.
    fourspaceshereCREATURE_CREEPER
    eightspaceshere- drop: CREATURE_CREEPER

    creepers arent dropping creepers
     
  19. Offline

    Celtic Minstrel

    I'm going to assume you do have a colon on the first of those lines plus the line "otherdrops:" above them...?
     
  20. Offline

    jespertheend

    How is this reacting with mcmmo? I really want to choose my own drops
     
  21. Offline

    Greylocke

    I've looked through the documentation and it seems like this isn't currently possible --
    but is there a way to trigger a drop when lightning strikes and breaks a block?
     
  22. Offline

    Celtic Minstrel

    I can't be certain; it may not interact well at all. Changing the priority setting could help though.

    Lightning strikes don't break blocks, so no. You can trigger a drop when lightning kills a mob though (DAMAGE_LIGHTNING). It might work on paintings and vehicles, or it might not.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  23. Offline

    kaasinees

    request to somehow make armors unbreakable....

    error:

    Code:
    09:40:49 [INFO] [OtherDrops:2.0-beta6] Events node created.
    09:40:49 [INFO] [OtherDrops:2.0-beta6] Events loaded: [LIGHTNING, STORM, THUNDER, SHEAR, UNSHEAR, SHEARTOGGLE, DYE, TREE, FORCETREE, EXPLOSION]
    09:40:49 [INFO] [OtherDrops:2.0-beta6] Loading file: otherdrops-drops.yml
    09:40:49 [SEVERE] Error occurred while enabling OtherDrops v2.0-beta6 (Is it up to date?): java.lang.NumberFormatException: For input string: ""
    java.lang.IllegalArgumentException: java.lang.NumberFormatException: For input string: ""
    	at com.gmail.zariust.otherdrops.options.Range.parse(Range.java:116)
    	at com.gmail.zariust.otherdrops.options.ShortRange.parse(ShortRange.java:35)
    	at com.gmail.zariust.otherdrops.options.ToolDamage.parseFrom(ToolDamage.java:48)
    	at com.gmail.zariust.otherdrops.OtherDropsConfig.loadSimpleDrop(OtherDropsConfig.java:363)
    	at com.gmail.zariust.otherdrops.OtherDropsConfig.loadBlockDrops(OtherDropsConfig.java:297)
    	at com.gmail.zariust.otherdrops.OtherDropsConfig.loadDropsFile(OtherDropsConfig.java:276)
    	at com.gmail.zariust.otherdrops.OtherDropsConfig.loadConfig(OtherDropsConfig.java:186)
    	at com.gmail.zariust.otherdrops.OtherDropsConfig.load(OtherDropsConfig.java:122)
    	at com.gmail.zariust.otherdrops.OtherDrops.onEnable(OtherDrops.java:250)
    	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:170)
    	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:957)
    	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:280)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:171)
    	at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:154)
    	at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:413)
    	at org.bukkit.Bukkit.reload(Bukkit.java:182)
    	at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
    	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:163)
    	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:355)
    	at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:351)
    	at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:506)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:485)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    Caused by: java.lang.NumberFormatException: For input string: ""
    	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
    	at java.lang.Integer.parseInt(Integer.java:493)
    	at java.lang.Short.parseShort(Short.java:114)
    	at java.lang.Short.valueOf(Short.java:169)
    	at java.lang.Short.valueOf(Short.java:195)
    	at com.gmail.zariust.otherdrops.options.ShortRange.staticParse(ShortRange.java:31)
    	at com.gmail.zariust.otherdrops.options.ShortRange.staticParse(ShortRange.java:5)
    	at com.gmail.zariust.otherdrops.options.Range.parse(Range.java:103)
    	... 23 more
    
    config:

    Code:
    include-files:
    ##########
    
    aliases:
    ##########
    
    defaults:
    ##########
        biomes: ALL
        worlds: ALL
    
    otherdrops:
    ##########
        ANY_BLOCK:
            - tool: ANY
              damagetool: -10 #0 did not work for on-breaking tools
        GLASS:
            &glassbreak
            - tool: ANY
              drop: NOTHING
            - tool: AIR
              damageattacker: 2-4
              message: "Ouch! Breaking glass with your bare hands hurts."
            - tool: [GLASS, THIN_GLASS]
              damageattacker: 4-8
              message: "Ouch! The glass shatters in your hand."
        THIN_GLASS:
            *glassbreak
        BOOKSHELF:
            - tool: ANY_AXE
              drop: BOOKSHELF
        WOOD_STAIRS:
            - tool: ANY_AXE
              drop: WOOD_STAIRS
        COBBLESTONE_STAIRS:
            - tool: ANY_PICKAXE
              drop: COBBLESTONE_STAIRS
        BRICK_STAIRS:
            - tool: ANY_PICKAXE
              drop: BRICK_STAIRS
        SMOOTH_STAIRS:
            - tool: ANY_PICKAXE
              drop: SMOOTH_STAIRS
        BOAT:
            - tool: ALL
              drop: BOAT
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  24. Offline

    Celtic Minstrel

    @kaasinees – Please update to beta7 and let me know if that error still occurs; if you get other problems, you can feel free to downgrade again, but a beta7 stack trace will make debugging easier for me, and it's also possible that the issue was already fixed in beta7.

    As for unbreakably armour, I don't think it's possible; however, you should be able to give a large negative durability to make it last longer (eg DIAMOND_ARMOR@-5000).
     
  25. Offline

    halley

    I had a lot of fun putting this multi-drop into the game. There wasn't much mention of the 'dropgroup' so I wanted to post this as another example.

    Code:
        BOOKSHELF:
            - tool: ANY
              dropgroup: Bookshelf
              drops:
                - drop: WOOD
                  quantity: 1-2
                - drop: PAPER
                  quantity: 1-2
                - drop: BOOK
                  quantity: 1-2
    
     
  26. Offline

    kaasinees


    hi, i found a mod that allows tools and armor to be invincible, it repairs tools when its damages... maybe you can add an option like called repair, otherwise the durability will go higher than its maximum i believe? Also is there a possibility to distinguish between ANY_TOOL and for example WOOL, does tool: ANY include wool or only tools?
    and are there options to take an item from the inventory or to replace the destroyed block with something else? for example when someone destroys ore it leaves a cobblestone behind. Or you can destroy a diamond block with a diamond pickaxe than it removes one diamond from inventory and places the diamond block back. stuff like that :)

    ANY_SHOVEL does not work

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  27. @Zarius & @Celtic_Minstrel
    Hello! Ive stumbled about a serious bug that regenerates tools in OtherDrops
    (Actually tested with CB 1323, OD 2.0 beta6-7 and also the latest OtherBlocks release)

    Problem:
    1. With the config I show below a right-click regenerates the damage tools have recently taken by usage (use a tool a bit, right-click will regenerate at least a part of it)
    2. Moveing used (damaged) tools between inventory and belt slots restores them.
    3. Used up tools dont get broken and removed from the belt slot but invisible instead - right-clicking while having that slot activated fully restores the tool. Same happens when you try to swap another item to the slot of the used-up item - the new item get swapped in and you suddenly hold a fresh item with your cursor that should have been used up previously!

    Code:
    sands.yml (only active config file in OtherDrops)
    
    otherblocks:
        SAND:
            - tool: ANY
              drop: SAND
              chance: 10
            - tool: ANY
              drop: NOTHING
    
     The idea of that config was to reduce the drop-rate to 10%.
    
    Maybe I just made a mistake in the config (?) but I guess that should not lead to items being restored?!
    Thanks, Alot! I really like this plugin and urgently need a fix for that for our server!
     
  28. Offline

    Celtic Minstrel

    Sorry, I should have clarified; I meant I didn't think it was possible within the scope of this plugin. Now that I think about it, though, you can probably do it for tools (not armour) by using "tooldamage: 0" somewhere.

    Durability never goes higher than its maximum. I'm not going to add a repair option; if you want that, especially for armour, get a separate plugin for it.

    Since there's ANY_ITEM, ANY_TOOL should include only tools.

    Sort of; you can use "consumetool" to take some of the item that was used. You can't take an arbitrary item from the inventory.

    Yes, "replacementblock: COBBLESTONE".

    Also, try ANY_SPADE instead of ANY_SHOVEL.



    @Zothen – I remember that bug; as I recall, it's related to the "drop: NOTHING" and is an unwanted side-effect of that (also occurs with 100% chances with non-players). You can get around it by adding "tooldamage: 1", though that won't be perfect since it won't retain the effect of tools taking 2 damage in certain situations.
     
    kaasinees likes this.
  29. Ive tried to set "tooldamage: 1" in both cases and tried it with either the "drop: Nothing" or "drop: SAND" case - nothing of that fixed the tool damage regeneration on right-click!
    Any chance for a bugfix? Unfortunatly this setting is fundamental for our new server... =/

    Edit: Also didnt fix the "invisible tool that should be used up and gone"- issue...

    Ive tried:

    Code:
    otherblocks:
        DIRT:
            - tool: ANY
              drop: DIRT
              chance: 10
              tooldamage: 1
            - tool: ANY
              drop: NOTHING
              tooldamage: 1
    
    otherblocks:
        DIRT:
            - tool: ANY
              drop: DIRT
              chance: 10
            - tool: ANY
              drop: NOTHING
              tooldamage: 1
    
    and:
    otherblocks:
        DIRT:
            - tool: ANY
              drop: DIRT
              chance: 10
              tooldamage: 1
            - tool: ANY
              drop: NOTHING
    
    Also funny - this setting doesnt give any drop but regens the used tool instead:
    (anything wrong with that config? I thought "drop: DEFAULT" is valid, right?)
    Code:
    otherblocks:
        DIRT:
            - tool: ANY
              drop: DEFAULT
              chance: 10
              tooldamage: 1
            - tool: ANY
              drop: NOTHING
              tooldamage: 1
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  30. Offline

    Celtic Minstrel

    @Zothen – Of the three things you tried, it'd be the second one that should work. For the default drop thing, I suspect "drop: NOTHING" is overriding the default drop even when it is explicitly specified. That shouldn't be the case, but handling default drops is a bit of a complex corner case which there really isn't any good way to handle at the moment.
     
  31. @Celtic_Minstrel , thanks for your reply! I dont really understand why that is a "complex corner case", cos afaik bukkit can easily listen for blockbreaks so applying a random chance to cancel that action or not does not seem like a biggy to me!
    Can you maybe point me to the file where the code is that handles this?
     

Share This Page