[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

    leocraft

    PigZombie;266:1.0
    Cow;266:1.0

    Well, for whatever reason pigzombies wont drop gold but cows will. I spawned em both with /spawnmob
     
  3. Offline

    Snowl

    Sadly not yet :/ I'm still trying to fix it though
    --- merged: Jan 31, 2011 5:18 AM ---
    PigZombie doesn't work in entity death for some reason :(
     
  4. Offline

    QQCucumber

    Have you thought about iconomy support? I think it'd be really cool to get currency from monsters or blocks.
     
  5. Offline

    Snowl

    I'll see what I can do! There are two bugs that i'm trying to fix, maybe after that.
     
  6. Offline

    r4NGe

    I am trying to keep a super balanced server. Therefore, only drops on redstone, diamond, coal, etc. (blocks that cannot be put down again to farm rare drops.)

    The mob drops are awesome, but people would just sit in traps and gather rare drops.

    Is it possible to only trigger drops when a mob is hit with a sword or shot with a bow?
     
  7. Offline

    Snowl

    Maybe. I'll look into it, but I am currently trying to fix a WorldGuard problem :C I don't think I could check what item, but I could make it drop if death is caused by player
     
  8. Offline

    r4NGe

    That would work nicely. Any method that could differentiate the deaths from possible trap kills. (cactus, lava, drowning, falls) Thank you so much for your work. Server loves this plugin!
     
  9. Offline

    Snowl

  10. Offline

    r4NGe

  11. Offline

    Snowl

  12. Offline

    Shay Williams

    Yo, when you use this plugin you can restore an item's durability by just opening inventory and moving it to a different spot :3.
     
  13. Offline

    Snowl

    pardon? o.o
     
  14. Offline

    Shay Williams

    When running your plugin, by dropping and picking up any tool/weapon in your inventory, its durability seems to go back to 100.
     
  15. Offline

    Snowl

    doesnt happen to me :confused: what version of blockdrops are you running, and bukkit, and other plugins?
     
  16. Offline

    Shay Williams

    Running newest blockdrops and 183 Bukkit; what's recommended?
     
  17. Offline

    Snowl

    try 185 and see if it works?
     
  18. Offline

    Shay Williams

    Nvm I'm dumb, didn't realize you updated 2.0 -> 2.2 :p.
     
  19. Offline

    Snowl

  20. Offline

    Meteo

    Just a question, but i did not find a solution! >.<... When it saids make a "file" i made a txt document, and did everything. the server could not find it! What should i do?


    So i used a notepad, and it worked. But This is the error that came out when i used it =/...

    Feb 1, 2011 3:26:12 PM org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event BLOCK_DAMAGED to BlockDrops
    java.lang.ArrayIndexOutOfBoundsException: 1
    at com.Snowl.bukkit.blockdrops.BlockDropsBlockListener.onBlockDamage(Blo
    ckDropsBlockListener.java:65)
    at org.bukkit.plugin.java.JavaPluginLoader$17.execute(JavaPluginLoader.j
    ava:205)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:60)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:213)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:355)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    at net.minecraft.server.NetworkManager.a(SourceFile:232)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:71)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:276)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:202)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
     
  21. Offline

    Snowl

    Hmm. Post your properties o.o
     
  22. Offline

    Slayer9x9

    Yeah I'm having the exact same problem...
    Here are my properties:
    Code:
    #Sand
    # 3 sand 5% of the time
    # 1 diamond 0.01% of the time
    12;12:0.05
    12;12:0.05
    12;12:0.05
    12;264:0.0001
    
    #dirt
    # 3 dirt 1% of the time
    # 1 diamond 0.01% of the time
    3;3:1.0
    3;3:0.01
    3;3:0.01
    3;3:0.01
    3;264:0.0001
    
    #grass
    # 3 dirt 1% of the time
    # 1 diamond 0.01% of the time
    2;3:0.01
    2;3:0.01
    2;3:0.01
    2;264:0.0001
    
    #stone
    # 3 cobblestone 1% of the time
    # 1 diamond 0.01% of the time
    1;4:0.01
    1;4:0.01
    1;4:0.01
    1;264:0.0001
    
    #leaves
    # 1 sapling 33% of the time (overwrite)
    # 1 apple 4% of the time
    18=0
    18;6;0.33
    18;260:0.04
    
    #wood
    # 3 wood 1% of the time
    # 1 iron axe 0.1% of the time
    17;17:0.01
    17;17:0.01
    17;17:0.01
    17;258:0.001
    
    #gravel
    # 1 gravel 50% of the time (overwrite)
    # 2 flint 2% of the time
    # 1 diamond 0.05% of the time
    13=0
    13;318:0.02
    13;318:0.02
    1;264:0.0005
    
    #iron ore
    # 1 iron ingot 3% of the time
    # 1 diamond 0.1% of the time
    15;265:0.03
    15;264:0.001
    
    #gold ore
    # 1 gold ingot 3% of the time
    # 1 diamond 0.1% of the time
    14;266:0.03
    14;264:0.001
    
    #diamond ore
    # 1 diamond 1% of the time
    56;264:0.01
    
    #coal ore
    # 1 diamond 0.02% of the time
    16;254:0.0002
    
    #lapiz lazuli ore
    # 1 diamond 0.5% of the time
    21;264:0.005
    
    #Zombie
    # 1 random leather armor 15% of the time for each
    # 1 iron ingot 5% of the time
    # 1 gold ingot 5% of the time
    # 1 diamond 0.01% if the time
    Zombie;298;0.15
    Zombie;299;0.15
    Zombie;300;0.15
    Zombie;301;0.15
    Zombie;265;0.05
    Zombie;266;0.05
    Zombie;264;0.0001
    
    #Skeleton
    # 3 extra arrows 10% of the time
    # 1 iron ingot 5% of the time
    # 1 gold ingot 5% of the time
    # 1 diamond 0.01% of the time
    Skeleton;262;0.10
    Skeleton;262;0.10
    Skeleton;262;0.10
    Skeleton;265;0.05
    Skeleton;266;0.05
    Skeleton;264;0.0001
    
    #Spider
    # 1 iron ingot 5% of the time
    # 1 gold ingot 5% of the time
    # 1 diamond 0.01% of the time
    Spider;265;0.05
    Spider;266;0.05
    Spider;264;0.0001
    
    #Creeper
    # 1 iron ingot 5% of the time
    # 1 gold ingot 5% of the time
    # 1 diamond 0.01% of the time
    Creeper;265;0.05
    Creeper;266;0.05
    Creeper;264;0.0001
    
    #CreeperExploded
    # 1 tnt 100% of the time
    # 1 iron ingot 5% of the time
    # 1 gold ingot 5% of the time
    # 1 diamond 0.01% of the time
    CreeperExploded=0
    CreeperExploded;46;1.0
    CreeperExploded;265;0.05
    CreeperExploded;266;0.05
    CreeperExploded;264;0.0001
    
     
  23. Offline

    Snowl

    What version of craftbukkit are you running?
     
  24. Offline

    Slayer9x9

    latest-latest: 210

    According to the error, the arrayindex exception happnes in every mob section of the onEntityDeath method.
    Code:
    if (Math.random() < Double.valueOf(params[1]))
    
    EDIT: HAHAHAHA nevermind...turns out I was using ";" instead of ":" - its all good.
    Awesome plugin btw.
     
  25. Offline

    Snowl

    All right, let me upgrade.
    --- merged: Feb 2, 2011 12:25 AM ---
    No problem here, but i see your problem: replace 01 with 0.1
     
  26. Offline

    Slayer9x9

    No thats not the issue - I got it working.
    Was using ";" instead of ":"
     
  27. Offline

    Snowl

    oh >_> sorry i r tired atm
     
  28. Offline

    Shay Williams

    Uhm, here's a weird problem.
    To recreate:
    1. Download newest Bukkit + BlockDrops.
    2. Block any block type, for example put '1=0' in your config.
    3. Run your server, acquire a tool, and mine/destroy the block type you blocked from dropping anything.
    4. Now open your inventory, pick up your tool, and it'll go back to max durability.

    This is big problem for servers using all block types, please advice.
     
  29. Offline

    Snowl

    I know about this problem, I need this to be implemented to be fixed: http://redmine.bukkit.org/issues/333#note-1 I need to be able to clear the drop :l It's currently using a hacky way to stop the drop dropping
     
  30. Offline

    Meteo

    @ David Diaz, i did

    Code:
    #Gravel:GoldOre:100%chance:0dmg:
    13;14;1.0:0:0
     
  31. Offline

    Snowl

    you have two ; :p
     
    Meteo likes this.

Share This Page