[MECH] OtherDrops 2.8- Ultimate block/mob/player drop editing [1.5.2]

Discussion in 'Archived: Plugin Releases' started by Zarius, Jun 12, 2011.

  1. Offline

    Zarius

    [​IMG]


    Want to fix glass/stairs/boat drops? Want to gather ice/glowstone/grass in a balanced manner? Want to smelt ore with golden tools? Want to cause chaos with undead that rise again? Now you can, simply by enabling the included example files or delve into the more advanced customisation and make drops work the way you want.

    OtherBlocks aims to give you ultimate control over what item that blocks/entities drop when destroyed, depending on how they were destroyed. Compatible with WorldGuard. Lightweight! Only scans what it needs to and ignores the rest.
    Download: BukkitDev (download link on there) | Source Code

    Included Modules
    * Fix undroppables: fix drops for stairs, glass (don't use your hands - ouch), boats & bookshelves (1.8 stairs included)
    * Gold tools (basic): gold tools have a chance of dropping the complete block for grass, ice & glowstone.
    * Gold tools (smelt): gold tools have a chance of mining an ingot directly from ores.
    * Ore Extraction: using the usual tools, ingots are ripped out of ores, leaving the stone behind.
    * Leaf overhaul: adds leaf drops (apples, cocoa, leaves, sticks & a very small chance of golden apple).
    * Undead Chaos: beware the night! Zombies & skeletons rise again and even players rise back from the dead (player deaths spawn more zombies/skeletons).
    * and more...

    Custom Configuration Examples
    Code:
        # Simple glass drop fix
        GLASS:
          - drop: GLASS
     
        # Players drop Zombies on death, 50% of the time
        PLAYER:
          - drop: CREATURE_ZOMBIE
            chance: 50%
     
        # Spiders killed with any sword at night have a 10% chance to drop web,
        # otherwise they drop whatever they normally would
        CREATURE_SPIDER:
          - tool: ANY_SWORD
            time: NIGHT
            drop: WEB
            chance: 10%
     
        # Trees drop apples (or cocoa from birch trees)
        SPECIAL_LEAFDECAY@GENERIC:
          - drop: APPLE
            chance: 5%
        SPECIAL_LEAFDECAY@BIRCH:
          - drop: DYE@BROWN
            chance: 5%
    
    If you are getting errors with the word "snakeyaml" in it, your config file isn't properly formatted.
    Test it on this website (or this one).

    See the dev.bukkit page for full details on how to set up OtherDrops, a complete parameters list and further examples.


    Changelog

    Newest changelog details here.


    Main author: @Zarius
    Contributors: @Celtic Minstrel, raws
    Original author: @cyklo
     
  2. Offline

    Zarius

    It's been removed by one of the documenters :) Probably because it's a bit out of date and the information can be found elsewhere on the site, I've put it back with a note however (for now - might remove later with a redirection to a 2.0 New Features page).

    It shouldn't crash like that but it seems you tried using CREATURE_ANY in your config? Seems to be a problem with that - posted an issue here.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  3. Offline

    Rofang

    It's possible you didn't program with this level of user ineptitude in mind, but here was my attempt:

    Code: (open)

    aliases:

    # Environmental damage:
    - &ENVIRON [DAMAGE_ENTITY_EXPLOSION, DAMAGE_FIRE, DAMAGE_CONTACT, DAMAGE_DROWNING, DAMAGE_FALL, DAMAGE_SUFFOCATION]

    # Any means of death except environmental damage:
    - &ANY_BUT_ENVIRON
    tool: ANY
    toolexcept: *ENVIRON

    # Deny mob farming via environmental damage when this alias is called:
    - &no_mob_farming
    tool: *ENVIRON
    drop: NOTHING
    exclusive: 99

    otherblocks:

    # Disable mob farming via environmental damage:
    CREATURE_ANY:
    - *no_mob_farming

    # Zombie pigman loot:
    CREATURE_PIG_ZOMBIE:
    - tool: *ANY_BUT_ENVIRON
    drop: {GOLD_SWORD@10-32, GOLD_INGOT}
    chance: 4%


    So anyway, I'm going to assume I botched that horribly and can remedy the crash by taking the environ nonsense out. But is that related to the /odr, etc. commands-not-working issue?
     
  4. Offline

    Celtic Minstrel

    Turns out I only did it for one or two parameters; I think colour/color/data and um... I forget the other one.

    Already did this. :) Now WOODEN_DOOR and WOOD_DOOR both refer to 324, while WOOD(EN)_DOOR_BLOCK refers to 64.

    Might be nice to make it context-sensitive, but that's probably too much work.

    Actually, I did add "flag: unique" for that purpose. I haven't tested it though, so use at your own risk. ;) If you do try it, note that you need to rearrange your drops within the block so that the unique ones are listed first.

    Actually, the log indicates he was using not CREATURE_ANY but ANY. Might be an artifact of your new single-material synonyms, though if so it should have been fixed by what I did to that. More likely it's something else.

    Oh wait, you do have CREATURE_ANY there... so what must have happened is that it stripped off the CREATURE_ and forgot to add it back on. You could try ANY_CREATURE and see if it works; I think both are supposed to have the same effect, though.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  5. Offline

    Rofang

    Kudos!

    Huzzah! Keeping my harebrained code but substituting ANY_CREATURE in place of CREATURE_ANY alleviates both the shutdown crash and the commands-not-working issues. I have no idea whether my code actually works in-game yet, but no crashes now. :)

    Edit: In reviewing the source code, it looks like you make extensive use of "ANY_CREATURE," and this also fits the pattern of all the other "ANY_" groups, so I'll change the documentation to say "ANY_CREATURE" instead of "CREATURE_ANY."
     
  6. Offline

    Zarius

    @Rofang

    A tweak to your config:

    Show Spoiler
    Code:
    aliases:
      # Environmental damage:
      - &ENVIRON [DAMAGE_ENTITY_EXPLOSION, DAMAGE_FIRE, DAMAGE_CONTACT, DAMAGE_DROWNING, DAMAGE_FALL, DAMAGE_SUFFOCATION]
    
      # Any means of death except environmental damage:
      - &ANY_BUT_ENVIRON
        tool: ANY
        toolexcept: *ENVIRON
    
      # Deny mob farming via environmental damage when this alias is called:
      - &no_mob_farming
        tool: *ENVIRON
        drop: NOTHING
        flag: UNIQUE
    
    otherdrops:
    
      # Disable mob farming via environmental damage:
      ANY_CREATURE:
        - *no_mob_farming
    
      # Zombie pigman loot:
      PIG_ZOMBIE:
        - <<: *ANY_BUT_ENVIRON  # the "<<:" allows you to add the extra parameters below
          drop: {GOLD_SWORD@10-32, GOLD_INGOT}
          chance: 4
    


    Previously (with tool: *ANY_BUT_ENVIRON) you ended up with:

    Code:
      - tool:
          tool: ANY
          toolexcept: ....
    
    @Celtic Minstrel

    Issue with the unique flag in the config above is that Rofang is using "CREATURE_ANY" to setup the no_mob_farming alias which is great and easy to do but there's no guarantee that the creature_any block will load first as it's an unordered list. I'll have to look into making unique work regardless or supporting the -BLOCK: format for an ordered list.

    I have some ideas about how to make unique work regardless...
     
    Rofang likes this.
  7. Offline

    cvxx7q

    @Zarius after that conversation i would say you have MANY ideas bouncing around atm ;)
     
  8. Offline

    Singso

    I've got 5 worlds and 2 Nethers (so 7?)

    With the old Download Beta4 my config works. ;)

    Code:
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] PerformDrop - checking for potential drops: action = BREAK target = LOG@GENERIC
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] PerformDrop - potential drops found: [BREAK on LOG] tool: PLAYER@SingsoL with GOLD_AXE@13
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] tool agent check : id=GOLD_AXE gettool=GOLD_AXE@13 material=GOLD_AXE id=mat:true
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] Tool match = true - tool=PLAYER@SingsoL with GOLD_AXE@13 tools={GOLD_AXE=true}
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] PerformDrop: dropping COAL@COAL
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] Performing SimpleDrop...
    2011-09-21 11:34:32 [INFO] [OtherDrops:2.0-beta4] SimpleDrop: dropped COAL@COAL x 1.1854624214105605
    
     
  9. Offline

    Rofang

    Oh, yeah, I see how I forgot what the ANY_BUT_ENVIRON alias was defined as; thanks. But also, I should note I wrote that code with intended redundancy, in that ANY_CREATURE's "no_mob_farming" was supposed to negate all environmental drops, but that individual mobs had some loot drops that were supposed to be environment-proof even if I ever decided to comment out the all-purpose "no_mob_farming" above. Is that redundancy still intact in the revised code?
     
  10. Offline

    Zarius

    Yes, the gold_sword and gold_ingot in the config above will only drop with anything but environmental damage (as set in the alias). Note that the previous way just plain wouldn't work :)
     
  11. Offline

    SirMcDufus

    This is a fantastic plugin. I read back a bit, and I was wondering if it was still planned to allow PLAYER to be used as a tool, or even better, PLAYER@NAME? I want to set it in such a way that when a certain "Hunter" player kills another player, they are rewarded with specific drops, but only when someone is killed by the hunter. Unless something like this is already possible... in which case I would feel silly.
     
  12. Offline

    Zarius

    Should be already possible but I haven't tested it because my test server usually only has me on it :D

    Also, not sure if it's useful to you but if you use permissions instead - then with the commands action you could transfer the "hunter" ability to whomever they killed (and/or remove it from the hunter at the same time). <- this isn't implemented in full yet though, we need to add the ability to use %p for the player name and %v for the victim name in commands.

    eg.
    Code:
      PLAYER:
        - tool: ANY
          permission: hunter # add otherdrops.custom.hunter to the player you want
          drop: DIRT
          message: ["Woo! Dirt! :D", "Yeah - there's some dirt...", "Hmm... well, could always use some more dirt..."]
     # the command - note, can't do this yet...  also the pex commands might be wrong, it's just an example.
          command: ["/pex user %p remove otherdrops.custom.hunter", "/pex user %v add otherdrops.custom.hunter"]
    
     
  13. Offline

    SirMcDufus

    Brilliant, I will test this as soon as I am able. Thanks a million.
     
  14. Offline

    nemanja

    Should I expect CREATURE_CHICKEN to be repaired on future updates?
     
  15. Offline

    Zarius

    I expect Bukkit will fix it soon (sheep issue didn't last long last time).
     
  16. Offline

    nemanja

    Oh I see, ok thanks ^_^
     
  17. Offline

    Zarius

    I've fixed the issue - should work fine in Beta6 (to be released soon).

    Version 2.0-beta6 (2011/09/22) - Download

    * support STEP@BRICK & STEP@SMOOTH_BRICK
    * fix issues with "worlds" in "defaults" section - made more robust
    * made "flags" more robust (flags: UNIQUE works now)
    * fix NPE (due to randomised loc not being initialised)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  18. Offline

    Celtic Minstrel

    The way to do this would be to sort all drop lists so that any with the unique flag are ordered before any without the flag. If I recall correctly how eg CREATURE_ANY works, it'll actually create the drop class and then add it to the hashmap multiple times, once for each possible creature or block that the alias can match (ignoring data), so it doesn't matter that we can't guarantee load order of different blocks. What matters is that we sort all drop lists, after everything has been loaded. Something like that, anyway.

    Also, our coordination seems to be suffering a bit; beta6 I think has about three things that I already fixed in my local repository. Oh well.
     
  19. Offline

    derekmiles

    noob problem whenever i kill anything by shooting it with arrows it drops nothing but the default. i have tried many different things, any help would make my day
     
  20. Offline

    Rofang

    I did a somewhat radical revision of the Actions, Effects, etc. page to make it more detailed. Input is welcome.
     
  21. Offline

    RugRats

    Face condition..... face is supported because I use it :D and it works just fine. Everything else is great. The (question marks) Zarius or Celtic will fill in or myself when I want to I guess ;O
    Also major renaming of the pages needs to be done :O Due to your changes ;o
     
  22. Offline

    Zarius

    I did ask for a push so I could integrate any changes but you'd already left for the day :D I wanted to get a beta out before I went to sleep as otherwise it would have been by at least 24 hours (busy night tonight). No problem though, I don't think they were big overlaps - as long as we don't spend hours working on the same things :D

    Looks great :) Yeah, leaving ?'s behind is fine - prompts me to fill bits of information in :D

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

    Rofang

    I had a plan for a new organizational scheme. I'll pm Zarius about it.
     
  24. Offline

    RugRats

    Mind sending it to me aswell? AKA: Add into conversation?
     
  25. Offline

    Rofang

    Sorry, didn't mean to leave you out. Welcome to the convo! (I'm still working on my organizational proposal.)
     
    RugRats likes this.
  26. Offline

    SirMcDufus

    Unfortunately this doesn't seem to work. Instead of the victim dropping the items of interest when killed by the hunter, the hunter drops them when killed in any way.
     
  27. Offline

    Celtic Minstrel

    True, they were generally smaller bugfixes.
     
  28. Offline

    Animosity

    I'd like to be able to define a group or groups of items and use a group to define what is droppable. Instead of defining individual drop chances for each potential item... for example, I'd like to have a group called 'wood_weapons' which consists of a wood axe, wood sword, and a stick. For loot options consisting of many items, this would be a much cleaner way to define the drop tables.

    Is there a similar feature to this already or would this be an enhancement?
     
  29. Offline

    Zarius

    Odd - only the player that has the "otherdrops.custom.hunter" permission should get the dirt drop when killing other players - will have to take a look at it later.

    This should already be possible:
    Code:
    aliases:
      - tool: &wood_weapons [WOOD_AXE, WOOD_SWORD, STICK]
      - drop: &awesome_loot [APPLE, EGG, GRASS, DIRT]  # using [] means drop all, using {} means drop "one of these"
    
    otherdrops:
      LOG:
        - tool: *wood_weapons
          drop: *awesome_loot
    
    There's a guide to using aliases here.
     
  30. Offline

    Undectectable

    do you know of any ready configs? im working on a hardcore survival server so i have to do every single drop. Like is there a faster way than doing this :
    CREATURE_SPIDER:
    time: NIGHT
    drop: WEB
    chance: 10%
    CREATURE_SPIDER:
    time: NIGHT
    drop: STRING
    chance: 10%

    CREATURE_SPIDER:
    time: day
    drop: air
    chance: 100%

    Im trying to make it spiders only drop web and string 10% of the time and only at night. Is there an easier way? thanks. Love the plugin
     
  31. Offline

    Rofang

    Aliases might come in handy when you're reusing some of the same parameters multiple times. See here.
     

Share This Page