[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


    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


    can u make it so like leafs drop apples and such?
  3. Offline


  4. Offline


    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.

            tool: WOOD_HOE
            drop: APPLE
            quantity: 1
  5. Offline


    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

    You should set an option for the % Chance that the item drops. For example:
    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".
    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


    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


    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


    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


    Nice idea. Perhaps a keyword such as "ALL"?
  11. Offline


    Would work perfectly.


    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.

            tool: DIAMOND_PICKAXE
            drop: LAPIS_BLOCK
            quantity: 6
            tool: IRON_PICKAXE
            drop: LAPIS_BLOCK
            quantity: 5
            tool: STONE_PICKAXE
            drop: LAPIS_BLOCK
            quantity: 4
  12. Offline

    Diet Taco

    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


    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


    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


    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:

            - tool: DIAMOND_PICKAXE
              drop: LAPIS_BLOCK
              quantity: 6
            - tool: IRON_PICKAXE
              drop: LAPIS_BLOCK
              quantity: 5
            - tool: STONE_PICKAXE
              drop: LAPIS_BLOCK
              quantity: 5
  16. Offline


    Erm, how come when I set things to be broken with tools like pickaxes, the tool breaks as well?
    Also here's my config:

          - tool: ALL
            drop: APPLE
            quantity: 1
            chance: 5
            damage: 1
          - tool: WOOD_PICKAXE
            drop: GLOWSTONE_DUST
            quantity: 6
            damage: 1
          - tool: STONE_PICKAXE
            drop: GLOWSTONE_DUST
            quantity: 9
            damage: 1
          - tool: GOLD_PICKAXE
            drop: GLOWSTONE_DUST
            quantity: 18
            damage: 1
          - tool: IRON_PICKAXE
            drop: GLOWSTONE_DUST
            quantity: 9
            damage: 1
          - tool: DIAMOND_PICKAXE
            drop: GLOWSTONE_DUST
            quantity: 9
            damage: 1
          - tool: GOLD_HOE
            drop: FIRE
            quantity: 1
            damage: 4
  17. Offline


    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


    Does anyone know if this plugin is compatible with WorldGaurd?
  19. Offline


    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


    I tested it with WorldGuard, it works okay so far.
  21. Offline


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

            - tool: FLINT_AND_STEEL
              drop: DYE
              color: GREEN
  22. Offline


    using version 0.2.3 of this plugin, build 325 of craftbukkit. getting the following error:
    SEVERE: Could not load plugins/otherblocks.jar in plugins: null
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:79)
        at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:117)
        at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:82)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:53)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
        at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
        at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:77)
        ... 8 more
    Caused by: java.lang.NullPointerException: Name is null
        at java.lang.Enum.valueOf(Enum.java:213)
        at org.bukkit.DyeColor.valueOf(DyeColor.java:10)
        at com.sargant.bukkit.otherblocks.OtherBlocks.<init>(OtherBlocks.java:118)
        ... 13 more
    Anything else needed from me?
  23. Offline


    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


                - tool: ALL
                  drop: SAND
                  quantity: 1
                  chance: 50
    Really basic, was just doing some testing. That's 100% of my config.yml.
  25. Offline


    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


    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?


    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


    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


    Cool, that's what I expected; just wanted to be sure. Thanks (on both counts!)
  29. Offline


    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


    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