[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

    Sroxah

    I apologize if this has already been asked. I skimmed through most of the recent responses first but don't think I saw someone asking this. Is it possible to use this plugin to make monsters only drop loot when directly killed by a player in some fashion?

    Essentially, I'm looking for something that disables mob grinders and forces players to have to engage a monster directly to get items to drop.

    If this is possible, would somebody be so kind as to throw together a quick sample of how I would go about doing it? I would be eternally grateful! :)
     
  3. Offline

    Taxen0

    I don't think there is a DAMAGE_PLAYER or something similar atm, but you could make something like:
    Code:
    CREATURE_CREEPER:
         - tool: ALL
           drop: DEFAULT
         - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING]
           drop: NOTHING
    
    ...
    ...
    ...
    
    and continue to add all damagetypes you don't want to reward a drop. the above would keep all lava, gravity and drowning traps from working atleast (I think).

    This would have to be added for each individual creature, see the wiki for creature variables and more damage types.
     
  4. Offline

    JuiceBox

    Hi, this looks like a great plugin but I'm having a bit of trouble.

    I'm trying to use this plugin on my world dedicated to the Minecraft game "Spleef"

    I want to configure it so all the colored wool blocks don't drop blocks when destroyed. Is there a way to change this so that the plugin recognizes the colored wool?

    This is what my config looks like so far...

    otherblocks:
    WOOL:
    - tool: TORCH
    world: spleef
    drop: WOOL
    color: WHITE
    quantity: 0
    damage: 1
    chance: 0
     
  5. Offline

    Celtic Minstrel

    Use WOOL@colour where colour is the colour you want to match. Or wait, even better, use WOOL@RANGE-1-15 (I think that's the correct syntax).

    By the way...
    • Specifying a chance of 0 guarantees that the drop rule will have no effect whatsoever. If you want it to drop nothing, you need to instead set it to drop AIR with a chance of 100.
    • The damage field will have no effect unless your tool is actually a tool (ie something that gets a damage bar when used).
     
  6. Offline

    cyklo

    Yup, as Celtic Minstrel said, use the RANGE identifier to identify everything except white wool

    Code:
    WOOL@RANGE-1-15:
      tool: ANY
      drop: NOTHING
    
     
  7. Offline

    Sroxah

    My goal is to disable all non-direct methods of monster killing. Essentially disabling monster grinders completely.

    I'm getting reports that drowning zombies are dropping feathers. I'm not sure if this applies to other damage types/monsters as I haven't had a chance to test first hand. Am I doing something wrong, perhaps? This is my config:

    Code:
    otherblocks: null
    CREATURE_CHICKEN:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_COW:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_CREEPER:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_GHAST:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_GIANT:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_MONSTER:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_PIG:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_PIG_ZOMBIE:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_SHEEP:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_SKELETON:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_SLIME:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_SPIDER:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_SQUID:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_WOLF:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
    CREATURE_ZOMBIE:
        - tool: ALL
          drop: DEFAULT
        - tool: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_DROWNING, DAMAGE_SUFFOCATION, DAMAGE_CONTACT]
          drop: NOTHING
     
  8. Offline

    cyklo

    That null should not be there [skeleton]. Have you even looked at your server logs to try and diagnose this problem? They'll say:

    Code:
    OtherBlocks: no values found in config file!
    When you remove that null, you'll find your indentation is all messed up too. The wiki explains how everything should be spaced.

    Edit: You've also just made me realize that ALL isn't much use now that DAMAGE and CREATURE options exist. I shall have to add a "ANY_WEAPON" option.
     
  9. Offline

    Sroxah

    D'oh! Thanks for the quick response! That was already in the settings file before I put anything else in so I thought it was supposed to be there. [pig]

    Everything is working happily now! Thank you for pointing that out![diamond]

    Edit: I realized my indentation was messed up after I fixed the first problem and it still wasn't working. It didn't take long to figure out why at that point.

    Double Edit:
    Should the current configuration work the way I have it set up currently, or is using ALL going to cause some unexpected issues?
     
  10. Offline

    Taxen0

    it should work fine, not sure how ANY_WEAPON will work but from the sound of it you would not be able to get drops by killing mobs with, lets say, a dirt block. if you would use that.
     
  11. Offline

    cyklo

    At the moment ALL covers everything: weapons, blocks, mobs, fire, drowning etc. There's a few ways of doing it, but I should add something that basically covers, as you say, only deaths where a player is directly responsible.

    Your config at the moment doesn't cover DAMAGE_ENTITY_ATTACK and the like, and listing out every DAMAGE value by hand is tedious and should be unnecessary.
     
  12. Offline

    Sroxah

    I have some players reporting that their grinders are still generating items, but I need to go in and confirm it with my own eyes when I get a chance. Is it possible that the ALL if overriding the damage types?

    I'll follow up on this post about whether or not grinders are still grinding.
     
  13. Offline

    Taxen0

    I don't think it should matter, but you cant try and swap place between tool:ALL and tool:[DAMAGE...].
    otherwise it may also be as you say.

    A second look a the code also gives the impression that some creature related groups are in order.
    like CREATURE_ALL, CREATURE_HOSTILE, CREATURE_ANIMAL, etc.
     
  14. Offline

    Celtic Minstrel

    Ah yes, I remember thinking about that at one point. I think I wanted to make wild wolves drop something iff they are directly killed by the player. Though, ALL is not entirely useless. Sometimes it'll still be what you want.

    It seems quite likely, since as I recall the drops are applied cumulatively.


    Hey, that might be useful.

    CREATURE_FRIENDLY: Cow, Chicken, Sheep, Pig, Squid
    CREATURE_ANIMAL: Cow, Chicken, Sheep, Pig, Squid, Wolf, possibly Spider
    CREATURE_UNDEAD: PigZombie, Zombie, Skeleton, possibly Giant
    CREATURE_HOSTILE: Zombie, Skeleton, Creeper, Spider, Ghast
    CREATURE_NEUTRAL: PigZombie, Wolf, possibly Spider
    CREATURE_WATER: Squid (since there might be more in future!)
    CREATURE_FLYING: Ghast (since there might be more in future!)
     
  15. Offline

    DontMakeWaves

    @cyklo and @Celtic Minstrel
    It seems like the person writing the config file should check to make sure the sum is not over 100%, and if they make a mistake, anything listed after the first item that adds up to 100% would naturaly be ignored without any special code to make it so. I'm guessing that when the code is run, it would go down the list if possible drops, rolling the dice for each one, and once one of them wins the roll, the rest are ignored, therefore making anything listed after 100% is reached, ignored 100% of the time. Is that correct? if it's not, don't feel obligated to explain it to me, you can just say that it isn't correct.:p
    I've had ideas about this feature, rolling around in my head, since Celtic Minstrel's first post on the the OtherBlocks forum, which had a huge list of suggestions. I'm not a coder (yet) so, I don't know how difficult this would be, but here is what I came up with for possible syntax:
    After each "drop: <item>" line, there could be an optional line such as "priority: <something>" where the options for this would be "and", "or", or "andor"; the default, I guess, would be "andor". An "ignore" option may be needed for "nothing drops"and "defualt drops", so that it wouldn't interfere with the or's or the andor's, but I don't know.
    and: listed drops with this priority can drop regardless of what else is droped, so if it wins the dice roll it will be droped even if something else droped. When a listed drop with the "and" priority is droped, listed drops with the "or" priority would be cancelled.​
    or: listed drops with this priority can only drop if nothing else drops, except items with a priority of "ignore". When a listed drop with the "or" priority is droped, other listed drops with the "or" and listed drops with the"andor" priority would be cancelled.​
    andor: listed drops with this priority can only drop if other listed drops with prioritys of "or" and "andor" do not drop, but they can drop if any number of listed drops with a priority of "and" and/or a priority of "ignore" is dropped. When a listed drop with the "andor" priority is droped, other listed drops with the "andor" and listed drops with the"or" priority would be cancelled.​
    ignore: just like "and" except When an item with this priority is droped, items with the "or" priority can be dropped. This priority won't interact with any other listed drops in any way; it will just be.​
    here is an example:
    Code:
        SAND:
            - tool: all
              drop: DEFAULT
              priority: ignore
            - tool: ALL
              drop: GRAVEL
              priority: and
              chance: 20
            - tool: ALL
              drop: LOG
              priority: and
              chance: 10
            - tool: ALL
              drop: STICK
              quantity: 10
              priority: and
              chance: 2
            - tool: ALL
              drop: IRON_ORE
              priority: andor
              chance: 2
            - tool: ALL
              drop: GOLD_ORE
              priority: andor
              chance: 1
            - tool: ALL
              drop: DIAMOND
              priority: or
              chance: 0.1
            - tool: ALL
              drop: GOLDEN_APPLE
              priority: or
              chance: 1
    If you ever emplement a priority system, I think the above syntax would fullfill the needs of most, if not all, server admins along those lines. I don't really need a priority option, myself, but I think others on this forum have mentioned that it would be usefull to them; plus, I think it would be fun to play around with. I hope that all made sence; I'm glad I'm not communicating this idea orally, all the ands, and ors and whatnot would get real confusing :confused:. :)
     
  16. @cyklo

    Would it be possible for you to add a feature that changes a block type when a tool is used on it?

    For example, say I have a water bucket and I pour this onto gravel, could I have the gravel turn into another block type, say clay?
     
  17. Offline

    DontMakeWaves

    @SpyDaniel
    That would be nice. I bet the bukkit team would rather it be done on a seperate plugin though. But I don't know. That plugin could also have lava turn sand into glass.
     
  18. Offline

    Celtic Minstrel

    Might be a touch more confusing for people, but instead of "or" and "andor" you could use "xor" (exclusive or) and "or" respectively.

    Apart from that, I'm not too sure how difficult it would be to code. I think it would not be terribly difficult since the drops are parsed sequentially, but the "andor"/"xor" would probably be the hardest.

    I don't see a difference between "and" and "ignore"; you say it's like "and" but without interfering with the two "or" values, but I don't see you saying that "and" ever interferes with the two "or" values.
     
  19. Offline

    DontMakeWaves

    I don't really care what the names of the priority options would be, whatever is least confusing, and works best for people would be fine, as long as the four options exist in some form. The names I gave are just suggestions.
    The definition I gave for "or" implies that an "and" drop would interfere with an "or" being droped. I just edited my previous post, I hope my edit makes it more clear. I think the "ignore" option is needed for when you use:
    Code:
        SAND:
            - tool: all
              drop: NOTHING
              priority: ignore
    so that dropping "NOTHING" at 100% chance would not cancel a drop with the priority of "or"; though I'm sure "ignore" could be used in more creative ways, I used it a little differently in the example in my previous post. I don't think the example in my previous post could be done if not all four priority options exist, but I could be wrong.

    @people that just got here: If you're confused, read post 323 first. It's just a few posts up, but it's kind of lengthy:rolleyes:.

    I changed my mind, I think "ignore" or "and" would be a better default for the priority line, but I'm sure that whatever cyklo chooses will be fine.

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

    Shay Williams

    I can't seem to get this to be compatible with big brother; whenever I modify a block's drop with this plugin, BB does not detect the block_break event. Any suggestions? I put priority on lowest already in the config file.
     
  21. Offline

    Celtic Minstrel

    My guess is that BigBrother doesn't log the event if it finds that it has been cancelled, and OtherBlocks cancels the event if you prevent the default drop from dropping. I don't think there's a clean way to solve this; you could ask BigBrother for an option to log cancelled events, but while that should work it would also produce many false alarms. I think the only real solution would involve some alternate way of determining whether the event was cancelled; some communication directly between OtherBlocks and BigBrother.
     
  22. Offline

    mireka

    Hi I tried setting drop for pork from pigs to 7%, but they seem to drop WAY more than 7%.

    What am I doing wrong?
    The setting for pig I'm currently using is

    Code:
        CREATURE_PIG:
            - tool: ALL
              drop: PORK
              quantity: 1
              chance: 7
            - tool: [GOLD_SPADE, GOLD_AXE, GOLD_HOE, GOLD_PICKAXE, GOLD_SWORD]
              drop: PORK
              quantity: 1-2
              chance: 14
    Thanks in advance.
     
  23. Offline

    Celtic Minstrel

    If they're dropping pork all the time and sometimes dropping it twice, then you haven't suppressed the default drop. Add this to your pig setup:
    Code:
         - tool: ALL
           drop: NOTHING
    I would put it first. I'm not sure if it actually matters. Note that even with this, it will be possible to get two pork using a gold tool, because gold tools are included in ALL.
     
  24. Offline

    mireka

    Any ways to avoid that without having to write everything but gold tools in the -tool?
     
  25. Offline

    Celtic Minstrel

    There is no way to avoid it. Technically you could write everything but gold tools, but that would be a very, very long list.
     
  26. Offline

    Vanoi

    Try putting the Gold Tool drop above the others.
     
  27. Offline

    haita

    With 705, when a block drops an alternate block it will reappear after a slight delay. When I mine the block again it drops nothing.

    My config:
    Show Spoiler
    Code:
    # OtherBlocks 0.7.4
    
    verbosity: low
    priority: lowest
    
    otherblocks:
        SPECIAL_LEAFDECAY:
            - drop: NOTHING
              chance: 100
            - drop: APPLE
              chance: 1
        LEAVES:
            - tool: ALL
              drop: NOTHING
              chance: 100
        DIRT:
            - tool: ALL
              drop: CLAY_BRICK
              chance: 20
        LOG:
            - tool: ALL
              drop: SAPLING
              chance: 20
        STONE:
            - tool: ALL
              drop: STONE
              chance: 100
              drop: COAL
              chance: 5
        GRAVEL:
            - tool: ALL
              drop: FLINT
              chance: 100
        GRASS:
            - tool: ALL
              drop: CLAY_BRICK
              chance: 20
        SOIL:
            - tool: ALL
              drop: CLAY_BRICK
              chance: 20
        CROPS:
            - tool: ALL
              drop: WHEAT
              chance: 100
     
  28. Offline

    cholo71796

    Any chance we could get an "or" sort of function, perhaps with weighted probabilities? For example, 75% of the time stone drops cobblestone, OR (the 25% of the time it doesn't) it drops smooth stone.
     
  29. Offline

    Celtic Minstrel

    Not sure, but I think this is a client desync issue.
     
  30. Offline

    haita

    Seems to be working normally again in 709.
     
  31. Offline

    Celtic Minstrel

    There was a Bukkit bug involving chunk update issues, so it's not implausible that 709 fixed it.



    @cyklo - When are you going to support breaking boats and minecarts?
     

Share This Page