[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

    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

    fuzzy_cobalt

    How would i make a birch tree drop birch logs and a pine tree drop pine logs and a redwood tree drop redwood logs? (otherwise this plugin is frickin amazing! so are all the other ones that you have made)
     
  3. Offline

    Celtic Minstrel

    Dispensers not dropping their content is a bug. I think furnaces not dropping their content is intentional. No idea about jukeboxes; I don't even know if they are considered a container.

    True... what I did was actually to make it break in one hit, so no matter what the damage was, it breaks (provided you have the tool). But I suspect VEHICLE_DAMAGE may be used to move the boat, so it might cause problems if the tool were "no tool".

    Technically they're not made-up (they're based off the names that appear in the client), but if you don't want to, it doesn't really matter.

    True; that's a limitation of the weights method.

    Yay!

    You're doing setCancelled(true) as well? Huh. Well, I guess it's not of huge importance.

    Yeah, this is what I have for bookshelves, and I get the books when breaking them with an axe (in addition to the block itself back). Chances for both are omitted and thus default to 100%.

    I noticed you were planning one of a list, and it's true that, with low probabilities, making them exclusive won't do much. Still, if you wanted cobblestone to have a 50% of dropping cobblestone and a 50% chance of dropping gravel (but not both), it can't be done in the current system.

    Hopefully by specials you don't mean the special events such as SPECIAL_LEAFDECAY?

    I think adding another "attacker" option field would be the best way to implement this.

    Thanks. I just might.

    It's currently not possible, but that's actually the default drop for the logs, so what's the problem?
     
  4. Offline

    glonq

    Love the plugin. A couple questions about creature death:

    - Is ARROW the tool for specifying 'death by arrow'? What about burning arrow?
    - What about death by fire (burning netherrack, fire pit, lava)?
    - What about death by drowning?
     
  5. Offline

    cyklo

    For something killed by arrow, BOW is the tool. Not sure what you mean by a burning arrow.

    Other modes of mob death besides from direct attacks will be implemented in the future.
     
  6. Offline

    Celtic Minstrel

    I think he said somewhere that BOW is the tool for that, but I could be mistaken and I see he just confirmed it as I wrote this post.

    I don't think these, or death by falling for that matter, are currently possible.
     
  7. Offline

    cyklo

    A side effect of this is that by specifying a tool of ARROW, you can specify a rarer drop for the more hardcore optionof "running up to them with the arrow and beating them round the face with it".
     
  8. Offline

    Celtic Minstrel

    But what if you run up to them with a bow and beat them around the face with it? :p
     
  9. Offline

    glonq

    In case anybody is looking for food for thought, I figured I'd share my config. What I'm trying to accomplish is this:

    1. Give a bonus for killing a creature with your bare hands (air), like giving you a skeleton's bow instead of just arrows. This is commented as #bare hands bonus
    2. Since gold weapons/tools are pretty useless right now, I made them sort of "magic items". Using them gives a chance of something interesting happening. This is commented as #gold bonus
    3. I wanted a chance of getting better/more loot from a creature or a block if I used better tools (iron, diamond). This is commented as #material bonus
    4. There's a random chance of getting different, better loot from monsters. Commented as #random loot bonus
    5. I also incorporated other people's ideas for leaf destruction/decay (sticks, apples, etc)

    I tried to make this pretty balanced and not turn it into a 'monty haul' operation. Suggestions/fixes are welcomed.

    PS - can I specify quantity as a range now? Does that work?

    Code:
    # Set this to "low" to reduce number of boot messages
    verbosity: high
    
    # Try adjusting this if you have compatibility problems with other plguins.
    # Default: "lowest". Can also use "low", "normal", "high", "highest".
    priority: lowest
    
    otherblocks:
     CREATURE_CHICKEN:
         - tool: ALL
           drop: BONE
           chance: 20
    #                bare hands bonus
        - tool: AIR
          drop: EGG
    #                gold bonus
         - tool: GOLD_SWORD
           drop: GOLDEN_APPLE
           chance: 15
    
     CREATURE_COW:
         - tool: ALL
           drop: BONE
           chance: 20
    #                gold bonus
         - tool: GOLD_SWORD
           drop: MILK_BUCKET
           chance: 5
         - tool: GOLD_SWORD
           drop: LEATHER
           chance: 10
           quantity: 5
    
     CREATURE_PIG:
         - tool: ALL
           drop: BONE
           chance: 20
    #                does fire even work?
        - tool: FIRE
          drop: GRILLED_PORK
    #                gold bonus
         - tool: GOLD_SWORD
           drop: SADDLE
           chance: 5
         - tool: GOLD_SWORD
           drop: GRILLED_PORK
           chance: 10
           quantity: 4
    CREATURE_SHEEP:
         - tool: ALL
           drop: BONE
           chance: 20
    #                gold bonus
         - tool: GOLD_SWORD
           drop: WOOL
           color: ORANGE
           chance: 2
         - tool: GOLD_SWORD
           drop: WOOL
           color: MAGENTA
           chance: 2
         - tool: GOLD_SWORD
           drop: WOOL
           color: LIGHT_BLUE
           chance: 2
         - tool: GOLD_SWORD
           drop: WOOL
           color: LIME
           chance: 2
         - tool: GOLD_SWORD
           drop: WOOL
           color: RED
           chance: 2
         - tool: GOLD_SWORD
           drop: WOOL
           color: YELLOW
           chance: 2
    
     CREATURE_SPIDER:
    #                bare hands bonus
         - tool: AIR
           drop: FISHING_ROD
    #                gold bonus
         - tool: GOLD_SWORD
           drop: GOLD_INGOT
           chance: 15
         - tool: GOLD_SWORD
           drop: DIAMOND
           chance: 5
         - tool: GOLD_SWORD
           drop: MOB_SPAWNER
           chance: 1
    #                material bonus
         - tool: WOOD_SWORD, STONE_SWORD
           drop: GOLD_INGOT
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD
           drop: IRON_INGOT
           chance: 1
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: GOLD_INGOT
           chance: 1.5
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: IRON_INGOT
           chance: 1.5
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD
           drop: DIAMOND
           chance: 0.5
    #                random loot bonus
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: EGG
           chance: 2
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: SULPHUR
           chance: 3
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: GLOWSTONE_DUST
           chance: 3
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: SADDLE
           chance: 1
    
     CREATURE_ZOMBIE:
    #                bare hands bonus
         - tool: AIR
           drop: CHICKEN
           quantity: 4
    #                gold bonus
         - tool: GOLD_SWORD
           drop: GOLD_INGOT
           chance: 15
         - tool: GOLD_SWORD
           drop: DIAMOND
           chance: 5
         - tool: GOLD_SWORD
           drop: MOB_SPAWNER
           chance: 1
    #                material bonus
         - tool: WOOD_SWORD, STONE_SWORD
           drop: GOLD_INGOT
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD
           drop: IRON_INGOT
           chance: 1
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: GOLD_INGOT
           chance: 1.5
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: IRON_INGOT
           chance: 1.5
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD
           drop: DIAMOND
           chance: 0.5
    #                random loot bonus
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: PAINTING
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: BOAT
           chance: 0.7
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: COMPASS
           chance: 0.7
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: WATCH
           chance: 0.7
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: CAKE
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: RAW_FISH
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: BROWN_MUSHROOM
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: RED_MUSHROOM
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: JACK_O_LANTERN
           chance: 1
         - tool: ALL
           drop: BONE
           chance: 20
    
     CREATURE_SKELETON:
    #                bare hands bonus
         - tool: AIR
           drop: BOW
         - tool: AIR
           drop: ARROW
           quantity: 16
    #                gold bonus
         - tool: GOLD_SWORD
           drop: GOLD_INGOT
           chance: 15
         - tool: GOLD_SWORD
           drop: DIAMOND
           chance: 5
         - tool: GOLD_SWORD
           drop: MOB_SPAWNER
           chance: 1
    #                material bonus
         - tool: WOOD_SWORD, STONE_SWORD
           drop: GOLD_INGOT
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD
           drop: IRON_INGOT
           chance: 1
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: GOLD_INGOT
           chance: 1.5
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: IRON_INGOT
           chance: 1.5
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD
           drop: DIAMOND
           chance: 0.5
    #                random loot bonus
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: ARROW
           chance: 10
           quantity: 8
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: ARROW
           chance: 5
           quantity: 20
         - tool: ALL
           drop: BONE
           chance: 20
    
     CREATURE_CREEPER:
    #                bare hands bonus
         - tool: AIR
           drop: TNT
           quantity: 10
    #                gold bonus
         - tool: GOLD_SWORD
           drop: GOLD_INGOT
           chance: 15
         - tool: GOLD_SWORD
           drop: DIAMOND
           chance: 5
         - tool: GOLD_SWORD
           drop: MOB_SPAWNER
           chance: 1
    #                material bonus
         - tool: WOOD_SWORD, STONE_SWORD
           drop: GOLD_INGOT
           chance: 1
         - tool: WOOD_SWORD, STONE_SWORD
           drop: IRON_INGOT
           chance: 1
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: GOLD_INGOT
           chance: 1.5
         - tool: IRON_SWORD, DIAMOND_SWORD
           drop: IRON_INGOT
           chance: 1.5
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD
           drop: DIAMOND
           chance: 0.5
    #                random loot bonus
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: SULPHUR
           chance: 10
           quantity: 8
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: SULPHUR
           chance: 5
           quantity: 20
         - tool: WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD, ARROW
           drop: GLOWSTONE_DUST
           chance: 5
           quantity: 1
         - tool: ALL
           drop: BONE
           chance: 20
    
     LEAVES:
         - tool: ALL
           drop: SAPLING
           chance: 5
         - tool: ALL
           drop: STICK
           chance: 3
         - tool: ALL
           drop: APPLE
           chance: 2
         - drop: CREATURE_SPIDER
           chance: 0.5
         - tool: ALL
           drop: GOLDEN_APPLE
           chance: 0.1
    #                gold bonus
         - tool: GOLD_AXE
           drop: GOLDEN_APPLE
           chance: 4
    
     SPECIAL_LEAFDECAY:
         - drop: AIR
           chance: 100
         - drop: SAPLING
           chance: 5
         - drop: STICK
           chance: 3
         - drop: APPLE
           chance: 2
         - drop: CREATURE_SPIDER
           chance: 0.5
         - drop: GOLDEN_APPLE
           chance: 0.1
    
     CROPS:
    #                gold bonus
         - tool: GOLD_HOE
           drop: WHEAT
           quantity: 2
           chance: 30
         - tool: GOLD_HOE
           drop: BREAD
           quantity: 1
           chance: 15
     
     GRAVEL:
    #                gold bonus
         - tool: GOLD_SPADE
           drop: NETHERRACK
           chance: 20
    #                material bonus
         - tool: IRON_SPADE
           drop: FLINT
           chance: 40
         - tool: DIAMOND_SPADE
           drop: FLINT
           chance: 60
    
     CLAY:
    #                gold bonus
         - tool: GOLD_SPADE
           drop: SOUL_SAND
           chance: 30
    
     REDSTONE_ORE:
    #                gold bonus
         - tool: GOLD_PICKAXE
           drop: GLOWSTONE_DUST
           quantity: 4
           chance: 40
    
     GLOWING_REDSTONE_ORE:
    #                gold bonus
         - tool: GOLD_PICKAXE
           drop: GLOWSTONE_DUST
           quantity: 4
           chance: 40
    
     IRON_ORE:
    #                gold bonus
         - tool: GOLD_PICKAXE
           drop: IRON_BLOCK
           quantity: 1
           chance: 5
    
     COAL_ORE:
    #                gold bonus
         - tool: GOLD_PICKAXE
           drop: NETHERRACK
           quantity: 1
           chance: 5
    
     
  10. Offline

    Celtic Minstrel

    Not yet.

    Your config file made me think of another idea; creaturebox-compatible mob spawner drops. Also, I note you didn't include cocoa beans (drop: dye, color: brown) in the leaf drops like I did. :p
     
  11. Offline

    xGONExCRAZYx

    Code:
    2011-03-19 22:25:02 [SEVERE] Could not load plugins\otherblocks.jar in plugins: null
    org.bukkit.plugin.InvalidPluginException
    	at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:113)
    	at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:159)
    	at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:107)
    	at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
    	at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    	at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: while parsing a block mapping
     in "<reader>", line 31, column 1:
        verbosity: low
        ^
    expected <block end>, but found Scalar
     in "<reader>", line 55, column 6:
             CREATURE_CREEPER
             ^
    
    	at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:576)
    	at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:163)
    	at org.yaml.snakeyaml.parser.ParserImpl.checkEvent(ParserImpl.java:148)
    	at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:228)
    	at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:160)
    	at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
    	at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
    	at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:124)
    	at org.yaml.snakeyaml.Yaml.load(Yaml.java:264)
    	at org.bukkit.util.config.Configuration.load(Configuration.java:73)
    	at org.bukkit.plugin.java.JavaPlugin.initialize(JavaPlugin.java:149)
    	at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:111)
    
    Why doesn't it work? I'm so confused D:
    I tested it with blocks and it does not work, but it has something to do with setting it for creatures. I deleted the creeper data, now it does the same thing for zombies.
    -EDIT-------
    I got rid of all the creature data, but then it just does it for glowstone! If i delete glowstone it will most likely just move on to the next hing so I won't even bother. but why doesn't it work?
    My plugins:
    BacktoBody, Bandages, Bedrock Control, Citizens, CraftBukkituptoDate, FishPeople, GodMode, Growbie, HelpCenter, iConomy, iMonster, IPLock, iZone, LocalShops, Lockette, LoginMessage, MinecartMania, Multiplehomes, Persistence, PlgDisableCmd, RealShop, SendGift, SimpleHome, Sortal, Spawnr, WorldEdit
     
  12. Offline

    Inacio

    What differences are there from this to DropBonus?
     
  13. Offline

    Celtic Minstrel

  14. Offline

    cyklo

    You must lay out the config file exactly as specified in the wiki.
     
  15. Offline

    xGONExCRAZYx

    @cyklo

    I don't see how anything is wrong.
    Code:
    priority: lowest
    
    otherblocks:
    
        LEAVES:
            - tool: ALL
              drop: AIR
              chance: 100
            - tool: ALL
              drop: SAPLING
              chance: 15
            - tool: GOLD_AXE
              drop: APPLE
              chance: 80
            - tool: GOLD_AXE
              drop: GOLDEN_APPLE
              chance: 15
            - tool: GOLD_AXE
              drop: DYE
              color: BROWN
              chance: 50
    
        CREATURE_ZOMBIE:
            - tool: ALL
              drop: MOB_SPAWNER
              chance: .5
            - tool: ALL
              drop: NETHERRACK
              chance: 100
            - tool: ALL
              drop: BONE
              quantity: 3
              chance: 100
    
        GLOWSTONE:
            - tool: ALL
              drop: GLOWSTONE
              chance: 100
    
        GLASS:
            - tool: ALL
              drop: GLASS
              chance: 100
    
        GRAVEL:
            - tool: GOLD_SHOVEL
              drop: FLINT
              chance: 100
            - tool: GOLD_HOE
              drop: CLAY
              chance: 100
            - tool: ALL
              drop: GRAVEL
              chance: 100
    
        GOLD_ORE:
            - tool: GOLD_PICKAXE
              drop: GOLD_INGOT
            - tool: ALL
              drop: GOLD_ORE
              chance: 100
    
        IRON_ORE:
            - tool: GOLD_PICKAXE
              drop: IRON_INGOT
              chance: 100
            - tool: ALL
              drop: IRON_ORE
              chance: 100
    
        SAND:
            - tool: GOLD_PICKAXE
              drop: GLASS
            - tool: ALL
              drop: SAND
              chance: 100
            - tool: GOLD_SWORD
              drop: SOUL_SAND
              chance: 100
    
        CLAY:
            - tool: ALL
              drop: CLAY_BALL
              quantity: 4
              chance: 100
            - tool: GOLD_PICKAXE
              drop: BRICK
              quantity: 4
              chance: 100
    
        WOOD:
            - tool: ALL
              drop: WOOD
            - tool: GOLD_PICKAXE
              drop: COAL
              chance: 100
    
        CREATURE_COW:
            - tool: ALL
              drop: LEATHER
              quantity: 3
              chance: 100
            - tool: GOLD_HOE
              drop: MILK_BUCKET
              damage: 4
              chance: 100
    
        CREATURE_PIG:
            - tool: GOLD_PICKAXE
              drop: GRILLED_PORK
              chance: 100
            - tool: GOLD_PICKAXE
              drop:BONE
              chance: 100
            - tool: ALL
              drop: PORK
              chance: 100
            - tool: ALL
              drop: BONE
              chance: 100
              quantity: 2
    
        CREATURE_CHICKEN:
            - tool: ALL
              drop: FEATHER
              quantity: 15
              chance: 100
            - tool: ALL
              drop: BONE
              chance: 100
    
        CREATURE_SQUID:
            - tool: ALL
              drop: INK_SACK
              quantity: 10
              chance: 100
            - tool: GOLD_PICKAXE
              drop: COOKED_FISH
              chance: 100
              quantity: 5
            - tool: GOLD_PICKAXE
              drop: INK_SACK
              quantity: 8
              chance: 100
    
        CREATURE_SPIDER:
           - tool: ALL
             drop: SOUL_SAND
             chance: 100
    
        CREATURE_SKELETON:
           - tool: ALL
             drop: GLOWSTONE_DUST
             chance: 100
             quantity: 2
           - tool: ALL
             drop: ARROW
             chance: 100
             quantity: 2
           - tool: ALL
             drop: BONE
             chance: 100
             quantity: 5
    
        CREATURE_CREEPER:
            - tool: ALL
              drop: SOUL_SAND
              chance: 100
            - tool: ALL
              drop: NETHERRACK
              chance: 100
            - tool: ALL
              drop: GLOWSTONE_DUST
              chance: 100
              quantity: 2
     
  16. Offline

    cyklo

    @xGONExCRAZYz

    None of your block type definitions for creatures are suffixed by a colon, e.g. "CREATURE_ZOMBIE" should be "CREATURE_ZOMBIE:".

    Edit: and now you've edited your original post. That still gives an error - as the teminal output says, on line 113 you have "drop:BONE" without a space. You should be using "drop: BONE" the same as everywhere else.
     
  17. Offline

    Vanoi

    Is there a way to check for the data value of the block we are destroy like wool colors and wheat growth? (Also grass growth if you use the vegetation plugin)
     
  18. Offline

    Celtic Minstrel

    No, but I think it's planned.
     
  19. Offline

    cyklo

    Wondering which would be the best syntax at the moment. Two options:

    Code:
    # This stores data values in a proper key,
    # but disassociates it from the logical parent block
        BLOCK_NAME:
            - datavalue: 7
              tool: BLAH
              other: stuff
    
    # This keeps the data value associated with the block name,
    # but is not as clear
        BLOCK_NAME@7:
            - tool: FOO
              stuff: specific_to_only_one_block_state
    
    Also, I'm not sure if @ is a special character in YAML. The snakeyaml java parser doesn't think so.
     
  20. Offline

    Celtic Minstrel

    Well, the first version perhaps is not as bad as you might think, since data values just represent variations on a particular block. Personally, however, I would prefer something more like the second, plus named values. For example: LOG@BIRCH, WOOL@GREEN, SLAB@SANDSTONE, CROPS@RIPE. (There's a pull request for enums containing some of those keywords.) Though I'm not sure what to think of the use of @.

    It seems to me that it wouldn't be that difficult to just implement both and let the users choose; there's no conflict that I can think of between them. You'd just (example: birch log) check for the basic form first (LOG), then (if not found) check for the embellished forms (LOG@2, LOG@BIRCH), else (if LOG was found) check for a datavalue key. Though it would be more work than implementing just one of them.
     
  21. Offline

    Killerrabbit

    Hello, and thank you for this most excellent addon!

    I have however a question/suggestion:

    Is it possible to make a a drop from a block only happen, if it has not been mined before?

    For example in my case I do not use iconomy and such on my server I try to have the ingame "gold" as the currency, feels more "realistic".
    So now I have the following feature, using a gold axe on a tree block, makes the tree block drop 2 tree, while all other tools on tree drop normal.
    However, now if you replace the tree block, if will ofcourse drop 2 tree blocks again.
    Is there a way to stop this so its only from "fresh" trees that can reward 2 tree blocks if for example golden axe is used? Or does not minecraft make a difference between server spawned things and player placed blocks?
     
  22. Offline

    cyklo

    Afraid not - minecraft does not discriminate between blocks generated by the world and those subsequently changed. The only way to do this would be to keep an inventory of every block that's ever changed - and things could get enormous. To be honest, your problem sounds like it could do with its own plugin for your specific problem.

    Alright, so an update on tonights' activities:
    • I have added the ability to specify what state the block must be in for a drop. The specification for this will be:
    Code:
    otherblocks:
        CROPS@RIPE:
          - tool: WHATEVER
        WOOL@RED:
          - tool: BLAH
    • There are now "synonyms" that allow you to specify whole groups of related blocks and items at once, e.g. ANY_REDSTONE_ORE would cover both REDSTONE_ORE and GLOWING_REDSTONE_ORE. There are also groups for tools such as ANY_PICKAXE
    • The full set of tools, blocks, items data values and colours have also been fully documented. Visit the wiki for the complete set!
    In addition, @Celtic Minstrel has been working on a few features such as dropping contents of containers (e.g. dispensers) that don't normally drop their contents when broken. I believe they're also adding entity-orientated weapons to allow you to specify things such as "tool: DAMAGE_EXPLOSION" (not sure of the final syntax!)

    I'll publish this either tonight or tomorrow. However, some of these new features require a bleeding-edge version of CraftBukkit. Therefore, you will need to upgrade to CraftBukkit Build #560 or better. Consider this advance warning!

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

    Celtic Minstrel

    Also, specifying a range for the quantity ("quantity: 3-5"). Still nominally working on entity-oriented "tools", but I'm probably going to start over.
     
  24. Offline

    cyklo

    90 minutes is enough warning! :p

    Just uploaded OtherBlocks 0.7 with a rather large number of changes for now, thanks to help from Celtic Minstrel! I'll add everything to the update log, but in essence: dropping blocks with any type of data value; synonyms for groups of similar items; specifying the state of blocks to drop from; dropping a number of items in a range; dropping the contents of containers. Check out the Wiki for full details and any new syntax you might need to know.

    Again, this needs CraftBukkit #560 or higher.
     
  25. Offline

    Vanoi

    I like the LEAVES@BIRCH and all but can we ALSO have the option to use Data Values as this would allow some cross-plugin combination like with the Vegetation plugin.
     
  26. Offline

    cyklo

    Does it not already do that? It should fall back to raw data values if it can't match the string. If not, I'll fix it in the morning.
     
  27. Offline

    Vanoi

    Ahhh... I see so Grass@6 would count towards a datavalue of 6?

    Edit: Nope, even the LEAVES@BIRCH seems to be giving me errors. (DLed the wrong version)

    Seems like Special_Leafdecay@Birch doesn't work yet.
     
  28. Offline

    Celtic Minstrel

    Actually, I think it only allows raw data values for those that don't have nice names available. So, GRASS@4 would work (and match nothing in a Vegetation-free world), but LOG@2 would not match birch.
     
  29. Offline

    Vanoi

    Yes, that as well. Leaves@0 would give you an errors while Leaves@generic worked fine. I have yet to actually test Grass (though I would assume allowing range of datavalues (eg:0-1,3-4) would help alot since Vegetation keeps increasing the data value as it grows.)
     
  30. Offline

    Dabbu

    Just updated to version 7.0 of otherblocks. Setup new config file to make alternate drops for animals, but getting an error in the server console when the animals die.

    2011-03-21 21:31:34 [SEVERE] Could not pass event ENTITY_DEATH to OtherBlocks
    java.lang.NullPointerException
    at com.sargant.bukkit.otherblocks.OtherBlocks.performDrop(OtherBlocks.java:362)
    at com.sargant.bukkit.otherblocks.OtherBlocksEntityListener.onEntityDeath(OtherBlocksEntityListener.java:92)
    at org.bukkit.plugin.java.JavaPluginLoader$39.execute(JavaPluginLoader.java:361)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    at net.minecraft.server.EntityLiving.o(EntityLiving.java:466)
    at net.minecraft.server.EntityLiving.a(EntityLiving.java:445)
    at net.minecraft.server.EntityLiving.a(EntityLiving.java:393)
    at net.minecraft.server.EntitySheep.a(SourceFile:69)
    at net.minecraft.server.EntityHuman.d(EntityHuman.java:451)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:748)
    at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
    at net.minecraft.server.NetworkManager.a(SourceFile:230)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)

    My Config.yml
    has the following entry for sheep.

    CREATURE_SHEEP:
    - tool: ALL
    drop: BONE
    chance: 20

    (EDIT: Added spaces to config lines. ok, it won't show the spaces here for the config lines. But, My config.yml file has all the right lines and no errors on loading.)

    I get no drop in game. But I see the error message logged to the server.

    Thanks,
     
  31. Offline

    cyklo

    Think I know why this is occurring. Opened issue 14, will solve later.

    Ah, no, leafdecay doesn't have the data thingy implemented. Yet.

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

Share This Page