[INACTIVE][MECH] BlockDrops v2.31 - Add and customize the items anything drops! [185+]

Discussion in 'Inactive/Unsupported Plugins' started by Snowl, Jan 25, 2011.

  1. Offline

    Snowl

    BlockDrops - Add and Customize the items your blocks ANYTHING drops!
    Version: 2.31
    By Request of http://forums.bukkit.org/threads/custom-drops-please.1198/#post-24213

    Ever wanted your dirt to drop a chainmail helmet? Want your sand to drop diamonds? Here's the answer!

    BlockDrops is a plugin that allows you to customize what your vehicles/blocks/mobs drop.

    Features (open)

    Features:
    • *Infinite* Block Drops per block
    • Any block is customize-able
    • Percentage System
    • Drop damaged blocks (different dyes dropped, different cloths)
    • Drop on break of boat/minecart
    • Drop on Creeper Explode
    • Drop on mob death



    Thanks to http://forums.bukkit.org/threads/kitplugin-v1-02-dispense-kits-to-your-players.1201/ for the properties help.

    Available blocks/mobs/vehicles to drop from:
    Blocks (open)

    All blocks, past and future.
    Monsters (open)

    • CreeperExploded
    • Spider
    • Skeleton
    • Zombie
    • Player
    • Cow
    • Chicken
    • Giant
    • Ghast
    • Pig
    • Creeper
    • Sheep
    • Slime
    Vehicles (open)


    • Boat
    • Minecart
    • PoweredMinecraft
    • StorageMinecraft


    How to use BlockDrops:
    How to Use (open)

    Create a file in the directory where CraftBukkit is, called "blockdrops.properties". This is where you adjust what drops what.
    Open up blockdrops.properties
    Add your custom drops. The format for adding drops is
    [Block/Monster/Vehicle];[Block/Item you want to drop]:[Chance for drop (Range 0.0001 to 1.0)]

    Extra options (only for blocks) are
    [Block/Monster/Vehicle];[Block/Item you want to drop]:[Chance for drop (Range 0.0001 to 1.0)]:[Damage the item has (Range from -127 to 127. Normal is 0)]:[Block/Item held to make Block/Item drop]
    You require the damage option if you have the Block/Item option, but both are optional.

    To make a Vehicle/Block/Mob not drop it's normal blocks add [Vehicle/Drop/Mob]=0 to override it.

    An example blockdrops.properties:
    Code:
    #blockdrops.properties
    #Overwrite stone's drops
    1=0
    #Always drop a cake
    1;92:1.0
    #Drop a broken wooden pickaxe 0.1% of the time
    1;270:0.001:100
    #Make a note block drop a boat
    25;333:1.0
    #Make a creeper drop a stone
    Creeper;1:1.0
    #Make a boat return a boat
    Boat=0
    Boat;333:1.0
    

    Changelog (open)
    Changelog:
    Version 2.31:
    • Fixed the WorldGuard and any other protected blocks issue.
    Version 2.3:
    • Fixed a bug where breaking a block but not breaking it at the last millisecond caused it to drop the item
    • Fixed a bug where breaking a block while protected by WorldGuard made it drop the item
    • Added creation of blockdrops.properties on startup
    Version 2.2:
    • Added overwrite for mobs
    Version 2.1:
    • Fixed version issues
    • Fixed Override issues
    Version 2.0:
    • Added dropping from every mob and animal, PoweredMinecraft and StorageMinecraft
    Version 1.5:
    • Added dropping from a boat or minecart when destroyed (besides when broken by itself)
    Version 1.45:
    • Added drops when using a certain tool
    Version 1.4:
    • Fixed a critical bug that would crash the client, stop saving of players data and NPE's after prolonged usage (again PropertiesFile >_<)
    Version 1.3:
    • Added damage for blocks so you can drop different wool colours and wool dyes (An example drop with damage is 1:351:1.0:11
    Version 1.2e:
    • Fixed a bug where propertiesfile overwrit the file.
    • Uploaded new version where fake lag is introduced to fix a bug.
    Version 1.2d:
    • Fixed a bug where destroying a block that had it's normal drop overwritten caused the next block to break slightly faster with a shovel.
    • Changed overwrite setting to [BLOCK]=0
    Version 1.2c:
    • Actually fixed a bug where destroying a block that had its normal drop overwritten destroyed a block next to it properly
    Version 1.2b:
    • Fixed a bug where destroying a block that had its normal drop overwritten destroyed a block next to it
    Version 1.2:
    • Adding 0:0.0 now overrides the normal blocks drop.
    Version 1.1:
    • You can now customize what a creeper drops once it explodes.
    Version 1.0:
    • Infinite block drops per block
    • Drops now drop at the block
    Version 0.7:
    • Bugfixes and in-ability to spawn air (as that corrupts the world)
    Version 0.6:
    • Percentage system implemented
    Version 0.5:
    • One custom drop per block
    Version 0.1:
    • Dropping blocks working
    • Initial Release
     

    Attached Files:

  2. Offline

    TrampOllen

    Whats with the folder called src?
     
  3. Offline

    Euphoriant

    That would be the source, in case you wanted to suggest a fix or addition or use the code in your own plugin.
    --- merged: Jan 26, 2011 12:37 AM ---
    Hooray! I will be testing this out soon. Many thanks for completing this!
    --- merged: Jan 26, 2011 2:55 AM ---
    So far so good. We noticed that we were actually able to add separate lines for different block drops instead of keeping them all in one line, just like you could in CustomDrops (we tried this because we have the old customdrops list and wanted to try and preserve it).

    Code:
    # Sand
    12;12:1.0
    12;20:0.001
    12;346:0.0001
    
    # Leaves
    18;6:0.05
    18;18:0.15
    18;280:0.1
    18;260:0.025
    18;322:0.0001
    
    #cloth
    35;287:0.75
    35;287:0.50
    35;287:0.25
    
    # Ice
    79;79:0.75
    
    # Glass
    20;20:0.75
    
    # Halfblocks
    43;44,44:1.0
    
    # Bookshelves
    47;340,340,340,5,5,5:1.0
    
    # Gold
    14;266:1.0
    14;266:0.1
    14;41:0.01
    14;1:1.0
    
    # Coal
    16;264:0.0001
    16;263:1.0
    16;263:0.1
    16;263:0.01
    16;1:0.25
    
    # Diamond
    56;264:1.0
    56;264:0.009
    56;57:0.005
    56;1:1.0
    
    # Grassy Dirt
    2;2:0.1
    2;3:1.0
    2;295:0.01
    2;262:0.0001
    2;318:0.001
    2;301:0.0001
    2;280:0.010
    2;39:0.05
    2;40:0.001
    
    # (Bitch ass)Hoe'd Dirt
    60;3:0 <-------- didn't stop dirt from dropping
    60;262:0.005
    60;263:0.001
    60;280:0.01
    60;302:0.0004
    60;318:0.01
    60;318:0.01
    60;295:0.1
    60;288:0.01
    60;287:0.01
    60;281:0.01
    60;336:0.01
    60;340:0.01
    60;337:0.01
    60;345:0.0005
    60;266:0.0001
    
    # Dirt
    3;3:1.0
    3;262:0.001
    3;263:0.0001
    3;280:0.001
    3;302:0.00005
    3;318:0.005
    3;318:0.005
    
    # Wooden Stairs
    53;53:1.0
    
    # Cobble Stairs
    67;67:1.0
    
    # Mobspawner
    52;306:0.05
    52;307:0.05
    52;308:0.05
    52;309:0.05
    52;310:0.005
    52;311:0.005
    52;312:0.005
    52;313:0.005
    52;320,320:0.09
    52;320,320,320:0.09
    52;264,264,264:0.01
    52;266,266:0.05
    52;266,266,266:0.03
    52;267:0.08
    52;276:0.005
    52;283:0.05
    52;302,303:0.1
    52;304,305:0.09
    52;331,331,331,331,331:0.05
    52;314:0.03
    52;315:0.03
    52;316:0.03
    52;317:0.03
    52;348,348,348:0.05
    52;348,348:0.05
    52;322,322,322:0.05
    52;289,289,289,289,289:0.05
    52;350,350,350:0.09
    52;262,262,262,262,262,262,262,262,262,262:0.05
    52;50,50,50,50,50:0.1
    52;261:0.05
    52;259:0.05
    
    # Snow
    
    78;78:1.0
    
    # Gravel
    13;13:0.4
    13;318:0.15
    13;318,318:0.09
    13;263:0.009
    13;15:0.001
    One issue that me and a player on my server have, a player whom has helped me configure our blockdrops.properties file, is that although we can now add multiple drops to single blocks, the original drop is not over-written. I didn't think this would be a problem at first, but I am seeing how it could be bothersome in some situations.

    For instance, using this plugin as an alternative for retrieving once irretrievable blocks can be annoying. Making stacked half blocks (item id 43) drop two single half blocks (item id 44) is possible, but with the current setup you would actually get 3 single half blocks because the original was never overwritten. Similarly, we have an extensive 'searching' system for hoed dirt where you hoe the dirt and then destroy the block to have a chance to find more random loot. However, to balance out the flow of items, we made it so hoed dirt did not drop dirt blocks. The balancing cannot be done because hoed dirt still drops a dirt block.

    We've even tried methods to perhaps halt the block drop by adding something like "60;3:0.0" which did not stop it from dropping.

    Perhaps you could implement an option within blockdrops.properties such as: Override-Original-Drops=true/false?
     
  4. Offline

    Snowl

    Updated! One line fix :D Let me upload it! Thanks for finding out about the single-line properties :D
    To stop a block dropping its normal block, add 0:0.0 (eg. 3;0:0.0)
    --- merged: Jan 26, 2011 6:08 AM ---
    Fixed a bug and updated to 1.2b
     
  5. Offline

    Euphoriant

    Hmm. Your latest update seems to have caused some issues. I'm experiencing the bug where blocks that have had their default drops overridden cause adjacent blocks to be removed at the same time. In addition, it seems that it was causing some bugginess while i was simply punching blocks, nearly Classic style block removal.
     
  6. Offline

    Snowl

    Try updating again :9 1.2b should have fixed that
     
  7. Offline

    Euphoriant

    Tried updating the .jar again. Same results, except I didnt start bugging while swinging my fists, which leads me to believe that that might have been a fluke. I am still getting the adjacent block removal and it seems that the default-override did not work on the blocks which it is intended.
     
  8. Offline

    Snowl

    Yeah, it's bugging for me as well :C it's proccing just too late :(
    --- merged: Jan 26, 2011 8:24 AM ---
    Ok, try now! I have tested this but not extensively. Could you report back if it does?
     
  9. Offline

    Euphoriant

    Alright, so it seems to be working a little better but now im noticing some other problems.

    First of all, when I override the default drop of grassy dirt it seems to work most of the time, though every so often it removes an adjacent block. Hoed dirt, on the other hand, removes an adjacent block every single time the block is removed. In addition, though it may be unrelated to your plugin, it seems that water casts a shadow on the sides of blocks (when the water isnt still).
     
  10. Offline

    Snowl

    Still can't get it to glitch :( Try putting 0:0.0 at the end of your hoed block section, and try, then at the front of the hoed block section.
     
  11. Offline

    Euphoriant

    Alright, I tried putting 0:0.0 at the end of the section, which seems to have solved the adjacent block removal dillema (for the most part, every now and again it removes another block). But now it seems like every other block I break takes only a fraction of the time it took to break the previous block.

    So it's like: Punch hoed dirt *hoed dirt breaks down normally*->Punch next block of hoed dirt *hoed dirt disappears without even playing a sound effect or bursting into particles, seemingly not dropping anything* If I use a shovel, it's even quicker because the block that takes less time to break takes even less time to break.


    I also tried arranging it into a single-line multi-drop format and tried moving the 0:0.0 to the front and the back of the line with no real difference in performance.
     
  12. Offline

    Snowl

    I can't seem to replicate this one, except with a shovel, where it breaks in half the time :( I'll see if I can fix this, gimme a min :D
    --- merged: Jan 26, 2011 10:14 PM ---
    Try now :D
    --- merged: Jan 26, 2011 10:17 PM ---
    Whoops, forgot to tell you get rid of the 0:0.0 and instead put the blockid you want to overwrite and put [blockid]=0 to overwrite.
     
  13. Offline

    Euphoriant

    Hmm, it seemed to be working at first, but when I went to the properties file it had reformatted and started adding new entries to itself. So I decided to experiment :) I deleted my blockdrops.properties and ran my server, i logged in and walked around and destroyed dirt blocks, grassy dirt, logs and leaves, disconnected, shut off my server and checked my server directory and sure enough I found that a new blockdrops.properties had generated and here is what was included in the generated file:
    Code:
    #Wed Jan 26 14:36:36 PST 2011
    3=1
    2=1
    0=1
    18=1
    17=1
    
     
  14. Offline

    Snowl

    Urgh, stupid PropertiesFile, I hate it so much! Let me fix it :(

    Done, uploading!
     
  15. Offline

    Euphoriant

    I also tried importing our customized blockdrops properties back into the file (making sure that the values to be overwritten=o) and it seemed to bring back the glitchy digging that I was experiencing before. Here is how it reformats:

    Code:
    #Wed Jan 26 14:50:42 PST 2011
    13;15=0.001
    3;280=0.001
    2;295=0.01
    13;263=0.009
    13;13=0.4
    78;78=1.0
    60;288=0.01
    60;287=0.01
    79;79=0.75
    60;281=0.01
    60;280=0.01
    56;264=0.009
    3;318=0.005
    52;348,348,348=0.05
    18;260=0.025
    52;304,305=0.09
    60;318=0.01
    18;18=0.15
    52=0
    2;280=0.010
    2;318=0.001
    3;302=0.00005
    52;262,262,262,262,262,262,262,262,262,262=0.05
    60;302=0.0004
    52;348,348=0.05
    3;263=0.0001
    3;262=0.001
    52;331,331,331,331,331=0.05
    67;67=1.0
    60;266=0.0001
    60;263=0.001
    60;262=0.005
    52;266,266,266=0.03
    52;322,322,322=0.05
    35=0
    16;264=0.0001
    16;263=0.01
    2;301=0.0001
    52;350,350,350=0.09
    12;346=0.0001
    52;302,303=0.1
    52;283=0.05
    52;50,50,50,50,50=0.1
    2;262=0.0001
    14;41=0.01
    2;3=0.5
    2;2=0.1
    52;289,289,289,289,289=0.05
    52;317=0.03
    52;316=0.03
    52;315=0.03
    20;20=0.75
    52;314=0.03
    35;287=0.25
    53;53=1.0
    52;313=0.005
    52;312=0.005
    52;311=0.005
    52;310=0.005
    13;318,318=0.09
    60;345=0.0005
    18;6=0.05
    52;276=0.005
    56;57=0.005
    60;340=0.01
    18;322=0.0001
    2=0
    0=1
    52;309=0.05
    18=0
    52;308=0.05
    52;307=0.05
    2;40=0.001
    52;306=0.05
    18;280=0.1
    14=0
    13;318=0.15
    13=0
    47;340,340,340,5,5,5=1.0
    60;337=0.01
    60;336=0.01
    43;44,44=1.0
    52;267=0.08
    14;266=0.1
    52;320,320,320=0.09
    52;261=0.05
    12;20=0.001
    52;266,266=0.05
    60;295=0.1
    2;39=0.05
    52;320,320=0.09
    52;264,264,264=0.01
    52;259=0.05
    60=0
    
     
  16. Offline

    Snowl

    dont use = only when you want to overwrite its the same format as before except if you want a block to be overwritten you put [block]=0
    so
    1=0
    1;276:0.5
    1;25:0.35
     
  17. Offline

    Euphoriant

    It all seems to function normally, except when I try to overwrite default drops. Without setting any block=0, I dont get any digging glitches and the custom drops seem to work just fine. I guess now the only problem comes from trying to overwrite the default drops.

    Just to make sure I'm not doing it wrong, to overwrite a drop you do something like this:

    # Grassy Dirt
    2=0
    2;2:0.1
    2;3:0.5
    2;295:0.01
    2;262:0.0001
    2;318:0.001
    2;301:0.0001
    2;280:0.010
    2;39:0.05
    2;40:0.001
     
  18. Offline

    Snowl


    Ok try this version: it introduces a slight fake lag into the block handling (unnoticeable) and seems to fix it completely for me...
    btw uploaded at top
     

    Attached Files:

  19. Offline

    Euphoriant

    That seems to have done the trick!
     
  20. Offline

    racu

    Nice!

    Can you add to Monsters drop?

    likes, Giant, Zombie, Spider, and so on
     
  21. Offline

    Snowl

    I have been looking into this, currently only creepers work, and even then when they explode.
    To make a creeper drop something use
    Creeper;
     
  22. Offline

    barghest

    Is it possible to use this to cause dyes (specific dyes) to drop? I'm looking to fix the "lapis lazuli drops only one dye" SMP bug, and this sounds like a pretty good way to make that happen.
     
  23. Offline

    Snowl

    ill look into that!
     
  24. Offline

    Euphoriant

    Im not certain if it would be possible to do this (yet). With this plugin you can make any block [itemID] drop any amount of any other block [itemID]. However, lapis lazuli dye has a modified version of the ink sack's item ID. Ink sack is 351, whereas lapis lazuli dye would be 351:4.

    You COULD make it so destroying a block of lapis ore, item ID 21, drops an entire block of lapis lazuli dye, item ID 22. This could be accomplished by adding this to your blockdrops.properties, minus the goofy arrow junk:

    21=0
    21;22:1.0

    ^ ^ ^-chance to drop (1.0=100%)
    \ \--block of lapis lazuli dye
    \---lapis lazuli ore

    This will overwrite the default drop so that finding that single block of lapis ore will render a total of 9 dye.

    Or you could just wait for an implementation for dropping different dyes :D
     
  25. Offline

    Snowl


    I have it working :D Let me upload it
    to add damage to a block add an extra :
    so e.x:
    4:351:1.0:11
    will drop yellow dye (11 damage)

    you don't need to add the damage variable this time though, so you dont need to edit your current blockdrops again, you can just add damage now
    --- merged: Jan 27, 2011 8:24 AM ---
    uploaded :D
     
  26. Offline

    Euphoriant

    That is AWESOME! This means you could make blocks drop different colored wool, and specific dyes.

    How does this not interfere with customizations to cobblestone [item id=4]?

    [edit] Oh, duh. The damage set at the end of the line determines the dropped blocks 'damage' or in this case, the type of dye. That means you could add all kinds of neat realistic events such as finding 'rusted' iron tools in the dirt that dont have full condition.
     
  27. Offline

    Snowl

    its just another block drop, but with damage added. you dont need to add damage for every block though :D

    Actually, it is damage! My bad :p
     
  28. Offline

    Euphoriant

    Edited previous post with my realization of this :D I gotta say again, great job!
     
  29. Offline

    Snowl

    Fixed a critical bug that would crash the client, stop saving of players data and NPE's after prolonged usage (again PropertiesFile >_<)
    Might want to update :D
     
  30. Offline

    Euphoriant

    Updated. So, Im experimenting with dropping slightly damaged tools. It seems to be working fine, but is 127 the max you can input for all block types or just specific ones? Because setting the damage to 127 on an iron sword takes it down to about half durability. I used the format:

    60;267:1.0:127
     

Share This Page