[INACTIVE][MECH] OtherBlocks v0.7.4 - Customize drops in combo with everything else [617]

Discussion in 'Inactive/Unsupported Plugins' started by cyklo, Feb 11, 2011.

  1. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    OtherBlocks - Customize what broken blocks and dead mobs drop!
    Version: 0.7.4
    Download: Jar File | Source Code
    Like this plugin? [​IMG]

    Main author: @cyklo
    Contributors: @Celtic Minstrel

    See the Wiki page for full details on how to set up OtherBlocks

    If you are getting errors with the word "snakeyaml" in it, your config file isn't properly formatted.
    Test it on this website.


    OtherBlocks is a plugin that lets you apply rules to what blocks drop when destroyed, depending on what tool you used. It is inspired by decino's goldenNether plugin.

    You can set rules in the configuration file to match any item with any block and give it a different drop item. For example, you could allow gathering of Glowstone Dust on the overworld by breaking Redstone ore with a golden pickaxe. Or you could allow ingots to be mined directly from their ores if you use Flint and Steel. Or you could invoke Isaiah Mustafa and decree "THE LEAVES ARE NOW DIAMONDS!"

    To install, simply decompress the contents to your plugins directory. Then, copy otherblocks/config.sample.yml to otherblocks/config.yml and edit away!

    Don't forget - to see how to edit the config file, check out out the Wiki!



    Changelog (open)

    Version 0.7
    • Added new drop types DEFAULT and NOTHING (0.7.4)
    • Fixed: creature drops don't work in specific worlds (0.7.4)
    • Added new mob types: CREATURE_GIANT, CREATURE_MONSTER, CREATURE_WOLF (0.7.3)
    • Will no longer throw problems with new types of mob when out of date (0.7.3)
    • Can specify creatures as the tool of death for mobs (0.7.2)
    • Can specify damage events as the tool of death for mobs (0.7.2)
    • Can specify data (colour) values for when you kill a sheep (0.7.2)
    • Fixed: doesn't work on CB 561+ (0.7.2)
    • Can specify data values for SPECIAL_LEAFDECAY events (0.7.2)
    • Large internal changes (0.7.2)
    • Fixed: number of spawned mobs did not obey config file (0.7.1)
    • Fixed: NullPointerException on mob item drop (0.7.1)
    • "color:" works for more than just wool and dyes, now works for wood, half-height blocks, crops etc. (0.7)
    • Synonyms, allowing you to specify groups such as "ANY_REDSTONE_ORE" and "ANY_PICKAXE" (0.7)
    • Can now specify data value of blocks you are dropping from, e.g. "CROPS@RIPE" (0.7)
    • Can now drop a number of items in a range (0.7) (by Celtic Minstrel)
    • Can now drop "CONTENTS" of containers, e.g. dispensers, furnaces (0.7) (by Celtic Minstrel)
    Version 0.6
    • Added SPECIAL_LEAFDECAY tag. See the wiki. (0.6.2)
    • Back-end changes to build process (0.6.1)
    • Multiworld support! Now you can customize drops on a per-world basis (0.6)
    Version 0.5

    • Now you can change what a mob drops when it is killed by a player! (0.5)
    Version 0.4

    • Fixed the map-break AIR bug (0.4.6)
    • Now specify multiple tools at the same time with syntax [TOOL_A, TOOL_B] (0.4.5)
    • Fixed incorrect colours of dropped dyes (0.4.4)
    • Added "ANY" as synonym for "ALL" (0.4.4)
    • Adjustable priority (0.4.3)
    • Can hide boot messages with "verbosity: low" (0.4.2)
    • Quantity and Damage bugfixes, works with Beta 1.3 (0.4.1)
    • Oh god, now you can spawn creepers (and other mobs) (0.4)
    • Fractional percentage chances such as 0.01% are valid (0.4)
    Version 0.3

    • Conforms to new plugin standards and breaks backwards compatibility (0.3)
    Version 0.2

    • Can now drop multiple items per block (0.2.5)
    • Fixed bug introduced in 0.2.3 (0.2.4)
    • Can now specify color of dropped item for wools and dyes (0.2.3)
    • Once again (and hopefully for the last time) fixed durabilities (0.2.2)
    • Changed to lowest priority, hopefully for better compatibility (0.2.2)
    • Fixed durability bug (0.2.1)
    • Change to config.yml format (0.2)
    • Can now specify multiple drops per block, based on different tools (0.2)
    Version 0.1


    • Added "ALL" selector for tools (0.1.3)
    • Workaround for bug in Bukkit whereby durability and max stack size are mixed up (0.1.3)
    • Added drop probability (0.1.2)
    • Customizable damage on block destruction (0.1.1)
    • First release (0.1)
     
    Steve Cole, g_BonE and tension69 like this.
  2. Offline

    Lookatmego

    My BukkitDev Profile
    My Plugins (2)
    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    can u make it so like leafs drop apples and such?
     
  3. Offline

    Racha

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
  4. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It can, with the following configuration block. I'd recommending setting apple-gathering to be done using the wooden hoe or similar instead of your bare hands, otherwise you'll override the default behaviour and leaves won't drop saplings.

    Code (Text):
    1.     LEAVES:
    2.         tool: WOOD_HOE
    3.         drop: APPLE
    4.         quantity: 1
     
  5. Offline

    Trigonous

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Is it just me or is the download link broken? I'd really like this to fix the amount that Lapis Lazuli and Glowstone drops...
     
  6. Offline

    Diet Taco

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    You should set an option for the % Chance that the item drops. For example:
    LEAVES:
    tool: AIR
    drop: APPLE
    quantity: 1
    chance: 75
    This would make it so that if you destroy leaf blocks with your hand, you'll receive an apple 75% of the time. Or 75 out of 100 leaf blocks will contain one apple. This could also be useful for making stone contain bones or "fossils".
    STONE:
    tool: GOLD_PICKAXE
    drop: BONE
    quantity: 1
    chance: 5
    The above would show that if you are mining stone with a Golden Pickaxe then you have a 5% chance of receiving three bones after mining a piece of stone.

    Also, is it possible to make it so that it can drop multiple items, for example have leaves drop saplings 85% of the time and have them drop apples 5% of the time, leaving the other 10% make them drop nothing. Could you do this, and add the chance the item drops?

    Great work on a simple to configure mod that is extremely useful!
     
  7. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Your first comment is something I will implement ASAP. Chance will default to 100, but if lower will only drop that item that percentage of the time, with the remainder of the time the block drops like normal. In your example, 75% of the time the leaves will drop an apple, in the other 25% it will drop its regular item with its regular probability.

    This also covers your second point if you have the regular sapling probability, however combining two non-regular drops (or increasing the sapling drop rate in tandem with an apple drop) is something that can't be done right now, but I will work on it.
     
  8. Offline

    QQCucumber

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Do you think you could implement a feature that lets you modify break speed? It'd be nice if obsidian didn't take all day to get.

    Edit: Unless that's what 'Customizable damage on block destruction' refers to, I can't tell..
     
  9. Offline

    Trigonous

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It seems to be working for me now.

    Is it possible to have EVERY tool have the same drop without specifying each one? Say leave the tool category blank? For instance, no matter what you harvest glowstone with (since anything can harvest it) it drops 9 glowstone dust.

    EDIT: Also, is it possible to specify more than one drop per block, with the percentage? (so long as it adds up to 100)
     
  10. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Nice idea. Perhaps a keyword such as "ALL"?
     
  11. Offline

    Trigonous

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Would work perfectly.

    EDIT:

    Here's my config file. Only the stone pickaxe one works. Possibly because it's the last one? It also appears that you cannot have a block drop Lapis Lazuli directly... though that would be a Bukkit problem.

    Code (Text):
    1. otherblocks:
    2.  
    3.     LAPIS_ORE:
    4.  
    5.         tool: DIAMOND_PICKAXE
    6.  
    7.         drop: LAPIS_BLOCK
    8.         quantity: 6
    9.  
    10.     LAPIS_ORE:
    11.  
    12.         tool: IRON_PICKAXE
    13.  
    14.         drop: LAPIS_BLOCK
    15.         quantity: 5
    16.  
    17.     LAPIS_ORE:
    18.  
    19.         tool: STONE_PICKAXE
    20.  
    21.         drop: LAPIS_BLOCK
    22.         quantity: 4
    23.  
     
  12. Offline

    Diet Taco

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Fantastic, it seems the "chance" option is working nicely. Thank you for implementing that so quickly [​IMG]

    The above would also be very useful, especially with the leaf example; Leaves drop apples 15% of the time.
    Can't wait to see "ALL" added in 0.1.3!
     
  13. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Yes, unfortunately it doesn't work as specified at the moment - it only picks up one of each "source" block definition. I'm having a look at it right now, and will fix it in the next couple of days. It'll require changing the format of the config.yml file.
    --- merged: Feb 13, 2011 11:53 PM ---
    0.1.3 add s a workaround for a bug in Bukkit whereby max stack size and max durability reported the wrong values. It also adds the ability to specify "ALL" as the tool.
     
  14. Offline

    arishoham

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Very nice mod! simple yet useful. But i was wondering if there was any way to add mobs? i want to add that if you kill a pig with flint and steel you get cooked pork.

    EDIT: also is there a way to add dye? i wanted it so that if you destroy cacti with flintandsteel you get green dye
     
  15. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Released 0.2. Now you can specify the actions of multiple tools on each block. Note that you have to change the format of your config.yml file slightly to work with the new version.

    As for the Lapis Ore example shown in post #11, this would now work like:

    Code (Text):
    1.  
    2. otherblocks:
    3.     LAPIS_ORE:
    4.         - tool: DIAMOND_PICKAXE
    5.           drop: LAPIS_BLOCK
    6.           quantity: 6
    7.  
    8.         - tool: IRON_PICKAXE
    9.           drop: LAPIS_BLOCK
    10.           quantity: 5
    11.  
    12.         - tool: STONE_PICKAXE
    13.           drop: LAPIS_BLOCK
    14.           quantity: 5
    15.  
     
  16. Offline

    General_Zero

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Erm, how come when I set things to be broken with tools like pickaxes, the tool breaks as well?
    Also here's my config:

    Code (Text):
    1. otherblocks:
    2.     LEAVES:
    3.       - tool: ALL
    4.         drop: APPLE
    5.         quantity: 1
    6.         chance: 5
    7.         damage: 1
    8.     GLOWSTONE:
    9.       - tool: WOOD_PICKAXE
    10.         drop: GLOWSTONE_DUST
    11.         quantity: 6
    12.         damage: 1
    13.  
    14.       - tool: STONE_PICKAXE
    15.         drop: GLOWSTONE_DUST
    16.         quantity: 9
    17.         damage: 1
    18.  
    19.       - tool: GOLD_PICKAXE
    20.         drop: GLOWSTONE_DUST
    21.         quantity: 18
    22.         damage: 1
    23.  
    24.       - tool: IRON_PICKAXE
    25.         drop: GLOWSTONE_DUST
    26.         quantity: 9
    27.         damage: 1
    28.  
    29.       - tool: DIAMOND_PICKAXE
    30.         drop: GLOWSTONE_DUST
    31.         quantity: 9
    32.         damage: 1
    33.     NETHERRACK:
    34.       - tool: GOLD_HOE
    35.         drop: FIRE
    36.         quantity: 1
    37.         damage: 4
     
  17. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    That'll be because of a bug. Basically there is an error in older versions of Bukkit that gets tool durabilities and maximum stack sizes mixed up. I wrote a couple of functions to detect if it was a broken Bukkit, and they weren't working correctly. Fixed in v0.2.1.

    Edit: no it wasn't. Fixed in 0.2.2.
     
  18. Offline

    Tahg Retired Staff

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Does anyone know if this plugin is compatible with WorldGaurd?
     
  19. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I'm unsure as I don't use WorldGuard, but in the version I've just uploaded (0.2.2) I've bumped the plugin priority down to Lowest. If it wasn't before, hopefully it should work better now.
     
  20. Offline

    enkryptor

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I tested it with WorldGuard, it works okay so far.
     
  21. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME

    Just uploaded 0.2.3. You should be able to now, with the following:

    Code (Text):
    1.  
    2.     CACTUS:
    3.         - tool: FLINT_AND_STEEL
    4.           drop: DYE
    5.           color: GREEN
    6.  
     
  22. Offline

    thejon

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    using version 0.2.3 of this plugin, build 325 of craftbukkit. getting the following error:
    Code (Text):
    1. SEVERE: Could not load plugins/otherblocks.jar in plugins: null
    2. org.bukkit.plugin.InvalidPluginException
    3.     at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:79)
    4.     at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:117)
    5.     at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:82)
    6.     at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:53)
    7.     at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
    8.     at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
    9.     at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
    10.     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
    11.     at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    12. Caused by: java.lang.reflect.InvocationTargetException
    13.     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    14.     at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    15.     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    16.     at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
    17.     at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:77)
    18.     ... 8 more
    19. Caused by: java.lang.NullPointerException: Name is null
    20.     at java.lang.Enum.valueOf(Enum.java:213)
    21.     at org.bukkit.DyeColor.valueOf(DyeColor.java:10)
    22.     at com.sargant.bukkit.otherblocks.OtherBlocks.<init>(OtherBlocks.java:118)
    23.     ... 13 more
    Anything else needed from me?
     
  23. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Just tried v0.2.3 against CraftBukkit b329 and Bukkit b159 and it works fine. Can you please check your config.yml file and paste its contents here?
     
  24. Offline

    thejon

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Code (Text):
    1. otherblocks:
    2. ##########
    3.         REDSTONE_ORE:
    4.             - tool: ALL
    5.               drop: SAND
    6.               quantity: 1
    7.               chance: 50
    8.  
    Really basic, was just doing some testing. That's 100% of my config.yml.
     
  25. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Oops. Entirely my fault, a stupid mistake sorry. After I introduced "color:" it apparently bombs out if you don't specify a colour. Just uploaded 0.2.4, which should fix it.
     
  26. Offline

    thejon

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks for the super fast fix! Confirmed working great now!

    Can I make a request too? Would it be a ton of work to allow the specification of a range in the quantity? Something like "quantity: 1-3" where it randomly selects 1,2 or 3 of whatever the drop is each time?

    Thanks!

    edit*** How does this work with natural leaf decay? Does that take this into account? (I have leaves given a 10% chance to drop apples. If I remove all the wood, and let the leaves decay naturally, vanilla MC drops saplings some of the time. Will it also drop apples some now? Or is this ONLY when using specified tool?))

    edit2 ** So, now I'm testing against redstone ore; and it's not dropping anything. It was working Dirt -> Sand, but Redstone_ore -> lapis_ore doesn't seem to be dropping either. Ideas?

    edit 3 ** ignore edit 2; I was using a stone pick. No drops that way that deep :/
     
  27. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Shouldn't be too hard.

    Any drops configured using this plugin only apply to blocks you break yourself - you have to harvest your own apples! Same goes for events such as a torch coming into contact with water - you currently can't override a torch being dropped when that happens, but you can override what happens when you destroy a torch yourself.
     
  28. Offline

    thejon

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Cool, that's what I expected; just wanted to be sure. Thanks (on both counts!)
     
  29. Offline

    cyklo

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    This may be because of the way Minecraft deals with Redstone Ore itself. When you attack REDSTONE_ORE, it turns into GLOWING_REDSTONE_ORE (sparkly bits). Make sure you have set rules for both (the same way you have to with DIRT and GRASS)
     
  30. Offline

    DontMakeWaves

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It would be cool if I could have an item drop multiple things... for example, I would like a sand block to drop a sand block 100% of the time, and also drop a clock (people lose things when they go to the beach) 0.05% of the time, a compass 0.1%, and a stick (driftwood) 1%, and maybe a few other items as well. This way you will always get sand, and sometimes you'll find a random item. Would this be difficult to do? Thanks.
     

Share This Page