[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

    Zarius

    Spacing is out a little - should be like this:
    Code:
    otherblocks:
        GLOWSTONE:
            - tool: GOLD_PICKAXE
              world: world
              drop: GLOWSTONE
              quantity: 4
    
     
  3. Offline

    XXXtheGreat

    Thanks! By the bye, do you happen to know of any plugins that can speed up how fast a certain block/item mines certain other blocks? Trying to get the gold pickaxe to mine ores faster, so the fact that it mines ingots will be more efficient than just mining and smelting separately.
     
  4. Offline

    Zaonhort

    Is OtherBlocks capable of having BigBrother log the blocks? I know some other custom drop plugins don't log the blocks with BigBrother (or rather BigBrother doesn't log them).
     
  5. Offline

    Zarius

    Tricky to do but I did read about one plugin recently that does it, try searching the forum for "faster mining." (edit: the plugin is LevelCraft)

    I made it work with the LogBlock API but haven't used BigBrother, will look into it.

    Found the problem - when dropping a material with quantity "0" it spawns that kinda infinite block (fills inventory but can't build with it). I've fixed this in version 0.9.1 by avoiding the "dropItemNaturally" function entirely if the quantity is zero.


    New version:

    Version 0.9.1 (2011/06/27)
    • messages now allow for %q as a placeholder for the quantity (eg. "You've found %q dollars.")
    • MONEY drops can now be decimal to two places (eg. 0.96-5.52)
    • MONEY drops can be negative (use ~ for a range - eg. -5~-2)
    • fix for dropItemNaturally with quantity zero spawning semi-infinite blocks
    • can now specify tool for paintings (for other damage only DAMAGE_WORLD works)
    • permissions now works for paintings and entities
    • messages now work for paintings and entities
    • permissions check defaults to disabled (enable at the top of the config file)

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

    Celtic Minstrel

    Hmmm... "A mole pops out and steals your money!"
     
  7. Offline

    Zarius

    If anyone's graphically inclined and has a little free time I was thinking of a logo for this plugin - I envision a player character in shock as he uses a pickaxe on a block and about 5 different types of items fly out in all directions along with a couple of spiders and a zombie - additionally a lightning strike zapping down to the block.

    Or perhaps a few blocks in a row somehow showing they have just been broken to drop different items and the last block the player is just breaking is the one with the spiders/etc jumping out of.

    Nice :D

    Tested against 935 and working fine.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  8. Offline

    Motumbo

    How can I get different saplings to come out. I always just get a generic sapling

    My real question ... There are 3 types of tree/logs in the game, the light brown, dark brown, and white. So does generic cover the light brown? Or does it cover all 3 of them?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  9. Offline

    r2a1p1

    This looks really cool, but when I download it, it doesn't come as a .jar or .zip it comes as a .gz which isnt recognized in my cmd and changing the extension gets it recognized but it just says that it couldn't load from otherblocks.jar . I'm sorry if this is a silly mistake on my part but how do I load this? I read the wiki and it just said to drop the .jar into the plugins folder ...like every other plugin...but I don't have the jar to drop into it. Im running CB v. 860, downloading with firefox 5 and have winrar as the primary extractor/opener type program, if any of that makes a difference. I would extremely appreciate any help on this. and yes I did make sure I clicked the "JAR file" download and not source code
     
  10. Offline

    Zarius

    Saplings weren't supported for multiple types by name - added in version 0.9.2. Example:

    Code:
            LEAVES@REDWOOD:
                - tool: ALL
                  drop: SAPLING
                  color: REDWOOD
                  chance:10
    
    Generic is just the standard tree (light brown).

    Fixed up the first post. The "jar file" link wasn't really a jar file - it was an archive similar to .zip. To simplify things I've made the download a .zip file instead of .tar.gz.
     
  11. Offline

    Motumbo

    Ok so generic is light brown aka oak. Redwood is the dark brown, aka pine, and birch is the white tree.

    So , when I set up the logs to drop logs, I have it set for LOG@Birch with 100% chance for it to drop 1-2 wood, but i never get any extra. The spacing is right. Dunno. THanks for clarifying the color variable that I need to add for the saplings.

    Im going to assume that I need to try something like the color thing with the logs too

    So something like
    Code:
            LOG@REDWOOD:
                - tool: ALL
                  drop: LOG
                  color: REDWOOD
                  chance: 100
                  quantity: 1-2
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  12. Offline

    Zarius

    Yup, the color bit is right. Try using 1-2 with no spaces and let me know if that works. Otherwise maybe try with quantity just two to see what happens?

    Edit: sorry looked like that quantity had spaces, checked again and it looks fine. Does quality: 2 work for you?
     
  13. Offline

    Motumbo

    k. I got the wood to work with the code I posted ... However. I did this
    Code:
    LEAVES@BIRCH:
            - tool: ALL
              drop: APPLE
              chance: 3
    
            - tool: ALL
              drop: GOLDEN_APPLE
              chance: .75
    
            - tool: ALL
              drop: AIR
              chance: 100
    
            - tool: ALL
              drop: SAPLING
              color: BIRCH
              chance: 5
    In doing this, same code basically for the redwood and generic as well ... I only get generic saplings out of all the the different leaves.
     
  14. Offline

    Zarius

    Did you download the new version (0.9.2)? If that doesn't work I'll try and fix it tonight. In the meantime you could just use the miners rather than color words. Eg. color: 0 color: 1 or color: 2
     
  15. Offline

    Motumbo

    Yeah, let me give that a shot.

    after updating to 9.2 it appears that the color names do not work at all, so I am back to only getting 1 drop per log no matter the log. So I guess I will use the color numbers for now and see if that works.

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

    Zarius

    Odd, colors worked fine in testing, will check it out again tonight. Yeah, numbers should work fine for logs too.
     
  17. Offline

    Celtic Minstrel

    Actually, there are more types of trees than logs.
     
  18. Offline

    WaterFalcon

    can you use data values with the config too?
    or is it only the words?
     
  19. Offline

    r2a1p1

    thank you for the help now its working
     
  20. Offline

    bk1138

    I think that was it -- it was the 0-n. I tried quoting it, but had the same problem. Once I changed it to 1 it worked perfectly. Perhaps it is ignoring the 0 or something? I will have to try 1-2 and see if there is an issue.... and maybe a 0 to see if that does anything.

    I am a bit concerned that the drops seem a bit high. I guess I will have to build a grinder and drop 1000 zombies in it to get some real stats, but I did kill 20 with a sword and got two chain helms (chance 3%), two pairs of leather leggings (chance 5%), an iron chestplate (chance 3%) 5 flint (chance 10%). I know that it is possible, but it seems like the random number is trending low, increasing the chance of a drop.

    Still using same bukkit and otherblocks as previously stated.
     
  21. Offline

    Motumbo

    K ... I got the saplings to drop correctly using the numbers for colors. However, I still cannot get multiple logs to drop from trees using either names or colors. This is the code I used for log.

    Code:
        LOG@BIRCH:
            - tool: ALL
              drop: LOG
              color: 2
              chance: 100
              quantity: 1-2
    
        LOG@REDWOOD:
            - tool: ALL
              drop: LOG
              color: 1
              chance: 100
              quantity: 1-2
    
        LOG@GENERIC:
            - tool: ALL
              drop: LOG
              color: 0
              chance: 100
              quantity: 1-2
    They drop the correct color of wood, but I think that is because the @Generic/redwood/birch is not replacing the drops due to them not working. Could I in theory use LOG@2 for birch?
     
  22. Offline

    RugRats

    @Zarius

    PIG@SADDLED gives an error


    Code:
    2011-06-26 22:02:21 [WARNING] Error while processing block PIG@SADDLED: No enum const class org.bukkit.Material.PIG
    2011-06-26 22:02:21 [SEVERE] java.lang.IllegalArgumentException: No enum const class org.bukkit.Material.PIG
    2011-06-26 22:02:21 [SEVERE]     at java.lang.Enum.valueOf(Unknown Source)
    2011-06-26 22:02:21 [SEVERE]     at org.bukkit.Material.valueOf(Material.java:14)
    2011-06-26 22:02:21 [SEVERE]     at com.sargant.bukkit.otherblocks.OtherBlocks.loadConfig(OtherBlocks.java:260)
    2011-06-26 22:02:21 [SEVERE]     at com.sargant.bukkit.otherblocks.OtherBlocks.onEnable(OtherBlocks.java:535)
    2011-06-26 22:02:21 [SEVERE]     at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:126)
    2011-06-26 22:02:21 [SEVERE]     at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:857)
    2011-06-26 22:02:21 [SEVERE]     at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:264)
    2011-06-26 22:02:21 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:151)
    2011-06-26 22:02:21 [SEVERE]     at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:136)
    2011-06-26 22:02:21 [SEVERE]     at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:284)
    2011-06-26 22:02:21 [SEVERE]     at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:271)
    2011-06-26 22:02:21 [SEVERE]     at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:148)
    2011-06-26 22:02:21 [SEVERE]     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:335)
    2011-06-26 22:02:21 [SEVERE]     at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  23. Offline

    QQCucumber

    @Zarius How would I go about configuring OtherBlocks to prevent monsters from dropping items when they drown or burn to death? (i.e. Preventing mobspawner farms.)
     
  24. Offline

    RugRats

    Add support for charcoal please.
     
  25. Offline

    Zarius

    Yes, only 3 tree species (GENERIC, BIRCH, REDWOOD - applicable to logs, leaves and saplings) but 5 tree types.

    Not yet, can only use numbers for the "color data" (eg. instead of LEAVES@GENERIC you use LEAVES@0). I do plan on allowing datavalues for the block however keep in mind that a lot of special cases have no matching number (eg. ANY_PICKAXE, SPECIAL_LEAFDECAY, CONTENTS, etc).

    Was definately the 0, setting quantity to zero causes the odd "infinite pork" issue for me too. Could be related to RB928, will have to test again with RB935 but for now (version 0.9.2) it just skips the drop code entirely if the quantity ends up being zero.

    Would be nice to see some stats on chances, I've had a suspicion that my drops are a little too high as well but hard to test, will look into this section of the code a bit more.

    Easiest way to test this would be to change the drop to something odd like an EGG temporarily. You can use LOG@2 in the block name however I haven't changed this code at all so LOG@BIRCH should work fine. Try the following and let me know how it goes?

    Code:
    LOG@BIRCH:
            - tool: ALL
              drop: EGG
    
    Ah, this should be CREATURE_PIG@SADDLED. The code needs to be able to distinguish between entities (creatures, etc) and blocks so all creatures need to be prefixed with CREATURE_

    Try COAL@CHARCOAL (or drop: COAL, color: CHARCOAL for the drop section).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  26. Offline

    RugRats

    Thanks and CREATURE_PIG:
    - tool: ALL
    drop: PORK
    quanity: 0-2
    chance: 100
    - tool: GOLD_SWORD
    drop: GRILLED_PORK
    quantity: 1-2
    it drops both grilled pork and pork when using gold_sword help please :D? I only want the pig to drop grilled pork with the gold sword
     
  27. Offline

    Zarius

    Try something like:

    Code:
            CREATURE_SKELETON:
                - tool: [DAMAGE_DROWNING, DAMAGE_FIRE, DAMAGE_CONTACT, DAMAGE_FALL]
                  drop: NOTHING
    
    DAMAGE_CONTACT is for catcus mob farming and DAMAGE_FALL if you want it for those that build a giant hole for mobs to fall into. You can also just nerf the mob farming by making it say drop the normal (or different) item at 1% chance (or even 0.01% chance or whatever).

    Yes, this is a known problem - for now perhaps just remove the pork drop (as pigs drop pork by default) and then the gold_sword should override the default (ie. you get only grilled). Thinking about making an "exclusive" flag or group somehow so that you have more control over drops.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  28. Offline

    Celtic Minstrel

    A COAL@CHARCOAL block would never be matched, because COAL is an item not a block.

    @RugRats – Not sure; try setting chance to 100 for the GOLD_SWORD one? Or, you may need to remove the regular one.

    Which reminds me, @Zarius – a way to invert the tool setting, perhaps? Or a way to specify "any item except blah".
     
  29. Offline

    RugRats

    Thanks. Also could you please take a look at my config and check for any problems?
    Code:
    otherblocks:
        GOLD_ORE:
            - tool: GOLD_PICKAXE
              drop: GOLD_INGOT
              quantity: 1
        IRON_ORE:
            - tool: GOLD_PICKAXE
              drop: IRON_INGOT
              quantity: 1
        CLAY:
            - tool: GOLD_SPADE
              drop: BRICK
              quantity: 4
        LOG:
            - tool: GOLD_AXE
              drop: COAL
              color: CHARCOAL
              quantity: 1
        GLASS:
            - tool: ALL
              drop: GLASS
              quantity: 1
        TNT:
            - tool: ALL
              drop: TNT
              quantity: 1
        GLOWSTONE:
            - tool: ALL
              drop: GLOWSTONE
              quantity: 1
        BOOKSHELF:
            - tool: ANY
              drop: BOOKSHELF
              quantity: 1
        BOAT:
            - tool: ALL
              drop: BOAT
              quantity: 1
        DOUBLE_STEP:
            - tool: ALL
              drop: DOUBLE_STEP
              quantity: 1
        COBBLESTONE_STAIRS:
            - tool: ALL
              drop: COBBLESTONE_STAIRS
              quantity: 1
        WOOD_STAIRS:
            - tool: ALL
              drop: WOOD_STAIRS
              quantity: 1
        STONE:
            - tool: DIAMOND_PICKAXE
              drop: STONE
              quantity: 1
              chance: 20
            - tool: GOLD_PICKAXE
              drop: STONE
              quantity: 1
        COBBLESTONE:
            - tool: DIAMOND_PICKAXE
              drop: MOSSY_COBBLESTONE
              quantity: 1
              chance: 20
            - tool: GOLD_PICKAXE
              drop: STONE
              quantity: 1
        DIRT:
            - tool: ALL
              drop: BUCKET
              quantity: 1
              chance: 1
            - tool: ALL
              drop: LEATHER_BOOTS
              quantity: 1
              chance: 1
            - tool: ALL
              drop: SADDLE
              quantity: 1
              chance: 1
            - tool: ALL
              drop: BOWL
              quantity: 1
              chance: 1
            - tool: ALL
              drop: MAP
              quantity: 1
              chance: 1
        GRAVEL:
            - tool: ALL
              drop: BUCKET
              quantity: 1
              chance: 1
            - tool: ALL
              drop: LEATHER_BOOTS
              quantity: 1
              chance: 1
            - tool: ALL
              drop: SADDLE
              quantity: 1
              chance: 1
            - tool: ALL
              drop: BOWL
              quantity: 1
              chance: 1
            - tool: ALL
              drop: MAP
              quantity: 1
              chance: 1
        GRASS:
            - tool: ALL
              drop: BUCKET
              quantity: 1
              chance: 1
            - tool: ALL
              drop: LEATHER_BOOTS
              quantity: 1
              chance: 1
            - tool: ALL
              drop: SADDLE
              quantity: 1
              chance: 1
            - tool: ALL
              drop: BOWL
              quantity: 1
              chance: 1
            - tool: ALL
              drop: MAP
              quantity: 1
              chance: 1
            - tool: ALL
              drop: SEEDS
              quantity: 1-3
              chance: 5
              time: DAY
            - tool: ALL
              drop: BROWN_MUSHROOM
              quantity: 1
              chance: 5
              time: NIGHT
        SAND:
            - tool: ALL
              drop: BUCKET
              quantity: 1
              chance: 1
            - tool: ALL
              drop: LEATHER_BOOTS
              quantity: 1
              chance: 1
            - tool: ALL
              drop: SADDLE
              quantity: 1
              chance: 1
            - tool: ALL
              drop: BOWL
              quantity: 1
              chance: 1
            - tool: ALL
              drop: MAP
              quantity: 1
              chance: 1
            - tool: GOLD_SPADE
              drop: GLASS
              quantity: 1
        CREATURE_CHICKEN:
            - tool: ALL
              drop: EGG
              quanity: 0-2
              chance: 100
            - tool: ALL
              drop: FEATHER
              quanity: 0-2
              chance: 50
        CREATURE_SHEEP:
            - tool: ALL
              drop: WOOL
              quanity: 0-3
              chance: 100
        CREATURE_PIG:
            - tool: GOLD_SWORD
              drop: GRILLED_PORK
              quantity: 0-2
        CREATURE_COW:
            - tool: ALL
              drop: LEATHER
              quanity: 0-2
              chance: 100
        CREATURE_PIG_ZOMBIE:
            - tool: ALL
              drop: GRILLED_PORK
              quanity: 0-2
              chance: 100
        CREATURE_SPIDER:
            - tool: ALL
              drop: STRING
              quanity: 0-3
              chance: 100
              time: NIGHT
            - tool: ALL
              drop: STRING
              quanity: 0-1
              chance: 100
              time: DAY
        CREATURE_ZOMBIE:
            - tool: ALL
              drop: FEATHER
              quanity: 0-2
              chance: 100
        CREATURE_WOLF:
            - tool: ALL
              drop: BREAD
              quanity: 0-2
              chance: 100
        CREATURE_SQUID:
            - tool: ALL
              drop: INK_SACK
              quanity: 0-3
              chance: 100
        CREATURE_SKELETON:
            - tool: ALL
              drop: BONE
              quanity: 0-2
              chance: 100
            - tool: ALL
              drop: ARROW
              quanity: 0-2
              chance: 100
        CREATURE_GHAST:
            - tool: ALL
              drop: SULPHUR
              quanity: 0-15
              chance: 100
        CREATURE_SLIME:
            - tool: ALL
              drop: SLIME_BALL
              quanity: 0-3
              chance: 100
        CREATURE_CREEPER:
            - tool: ALL
              drop: SULPHUR
              quanity: 0-3
              chance: 100
              time: NIGHT
            - tool: ALL
              drop: SULPHUR
              quanity: 0-1
              chance: 100
              time: DAY
        CREATURE_PIG@SADDLED:
            - tool: ALL
              drop: SADDLE
              quantity: 1
    I spent about 2 hours typing this all out hehe
     
  30. Offline

    Zarius

    Doh - you're right, there are no charcoal blocks ^_^

    Yeah, definately want to add an except rule. eg. "-tool: [ANY_PICKAXE, ANY_AXE] EXCEPT [GOLD_PICKAXE, DIAMOND_AXE]" or just "-tool: ALL EXCEPT [blah]".

    Took a look over it and it seems fine, some comments below:

    Doublestep – doublesteps never usually drop, I'm guessing this is what you want though. Also due to color values you'll probably need to do a section for each type of doublestep (eg. DOUBLESTEP@WOOD)

    Maps from dirt,etc – what color value? Keep in mind the default value is 0 so this will generate map 0 only. Also I'm not sure (yet) of the effect dropping a map that hasn't yet been created in the world would have.

    Dirt/grass/gravel drops seem a bit high. I often fill a double chest with dirt and with this value I'd get around 34 each of buckets, saddles, maps, leather boots and bowls. I'd end up throwing buckets away because I had so many. Keep in mind that chance values can be lower than one – I'd probably use something like 0.05% (adding up all the percentages give you a 1 in 400 chance of a special item – currently at 1% it's a 1 in 20 chance, every 20 blocks gets you a bonus item).

    Cow – isn't this the default drop (0-2 leather)?

    Poor wolves with players killing them for bread :/

    I like the higher chance of getting string from spiders at night and lower at day.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  31. Offline

    Celtic Minstrel

    Probably you'd have to do something like this:
    Code:
    - tool: [ANY_PICKAXE, ANY_AXE]
      except: [GOLD_PICKAXE, DIAMOND_AXE]
    I tried getting one with /give once. The resulting map may or may not show some map data, but it won't show the marker of where you are and (I'm pretty sure) won't work as a map in general.

    At least make it so that tamed ones don't drop it. :/
     

Share This Page