[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

    gawelium

    thank's.
    like this ?
    Code:
    LOG@BIRCH:
            - tool: ANY_AXE
              drop: LOG@BIRCH/100%/1-3
              permissions: bucheron
            - tool: DIAMOND_AXE
              drop: MONEY/50%/0.01-0.9
              message: &9 Tu obtiens un peu d'argent &b (%q CrazyCrafts)
              permissions: bucheron
    
     
  3. Offline

    Zarius

    Yup, that should work - just test it out :)
     
  4. Offline

    gawelium

    :( doesn't work
    Code:
    [SEVERE] Error occurred while enabling OtherDrops v2.2.1 (Is it up to date?): found duplicate anchor 9; first occurence; second occurence
    found duplicate anchor 9; first occurence
     in "<reader>", line 12, column 20:
                  message: &9 Tu obtiens un peu d'argent &b ... 
                           ^
    second occurence
     in "<reader>", line 23, column 20:
                  message: &9 Tu obtiens un peu d'argent &b ... 
                           ^
    
     
  5. Offline

    Zarius

    Ah, you need quotation marks around it. ie. "&9colored text...."
     
  6. Offline

    gawelium

    Thank's. Works :D
     
  7. Offline

    Hopium

    Zarius got it figured out i was pointing to drops.yml not include/drops.yml and it auto generated the file so there was no errors im just a slow kid, another quick question is do have to disable the default drops for each custom drop or is there a way to do it globally. thats awesome about the skins, now i can make skeleton knights and goblins!!
     
  8. Offline

    Zarius

    You should be able to use "drop: NOTHING" and then specify your own drops.

    For doing it globally:

    Code:
      ANY_BLOCK:
        - drop: NOTHING
      ANY_CREATURE:
        - drop: NOTHING
    # rest of your config down here...
    
     
  9. Offline

    Hopium

    ok i included that into my config but i am still getting strange behavior i uploaded a video showing what i mean cause it would be easier i think then explaining, the exclusive isn't working properly i believe and its tripling drops sometimes i'll include my config again and here is a quick video at :35 you see it drop xp and gold even tho they both have exclusive 1 and a few double triple drops

    log excerpt just me reloading with 0 errors in config and no others showing up while killing mobs
    Code:
    2012-01-30 22:00:19 [INFO] [OKLogger] [COMMAND] <BeyondLSD(192.168.1.1)>@DefianceMC(651,63,-911) : /od reload
    2012-01-30 22:00:19 [INFO] [OtherDrops:2.2] Events node created.
    2012-01-30 22:00:19 [INFO] [OtherDrops:2.2] Events loaded: [EXPLOSION, SHEAR, UNSHEAR, SHEARTOGGLE, DYE, TREE, FORCETREE, LIGHTNING, STORM, THUNDER]
    2012-01-30 22:00:19 [INFO] [OtherDrops:2.2] Loading file: otherdrops-drops.yml
    2012-01-30 22:00:19 [INFO] [OtherDrops:2.2] Loading file: includes/drops.yml
    2012-01-30 22:00:19 [INFO] [OtherDrops:2.2] Using Bukkit superperms.
    2012-01-30 22:00:19 [INFO] [OtherDrops:2.2] Config reloaded by BeyondLSD.
     
  10. Offline

    durand1w

    Sorry if I missed this, but do you have an example(s) on the vanilla CREATURE_ENDERDRAGON drop and how to modify it? Our server has a small hoard of ender dragons due to a bug in the end.
     
  11. Offline

    Zarius

    Hopium - testing your config and you're quite right, the exclusive parameter doesn't seem to work as intended. I'm trying to track down the bug now.

    Just to clarify - you're using it to try and have dropgroups where only one of a set will drop, right? If I could code it (which would be tricky) would something like this work?

    Code:
      SPIDER:
        - dropgroup: xp_or_money
          drops:
            - drop: MONEY
              flags: UNIQUE
            - drop: XP
              flags: UNIQUE
        - dropgroup: loot
          drops:
            - drop:WEB
              flags: UNIQUE
            - drop: SPIDER_EYE
              flags: UNIQUE
            - drop: PICKAXE
              flags: UNIQUE
    
    Currently this would cause all the drops to be unique but if I could make the unique flag work within the hierarchy then the "unique" would only work within the context of the dropgroup. If you wanted unique dropgroups (ie. if this dropgroup matches then no other top level drops or dropgroups will occur) then you add the unique flag to the dropgroup. Just some thoughts.


    durand1w

    Should be fairly easy - a simple example (add to the end of otherdrops-drops.yml, or add your own config file and make sure it's included in the otherdrops-drops.yml file):

    Code:
      otherdrops:
        ENDERDRAGON:
          - drop: APPLE
    
    Did you have something specific in mind?

    Everyone - just an idea, would it be easier it the plugin just checked for any .yml files in the includes folder? The example configs could be renamed (eg. "od-zarius_overhaul.yml.off") and you just remove the .off bit to activate them. Or would this be confusing?

    How easy did you find it when you started with OtherDrops to work out how to add extra include files?

    Prerelease of 2.3 - could be buggy! Removed exclusive parameter, replaced with enchanced unique flag (as described above), revamped aliases (should now work with 1.0.1).

    Removing exclusive will likely break some configs but as exclusive was already broken I'm not sure how many would have been using it in recent builds.

    Since this was a large rewrite of a core function it'll need some testing - please let me know if you have any issues with it (I ran it through a bunch of testing before I released it though, worked fine for me but easy to overlook something).

    gawelium - this pre-release should work with 1.0.1 but I haven't had time to test it yet.

    Hopium - this should work now (you'll have to put your chance percentages back in, I made them all 100% for testing.

    Code:
        SPIDER:
          - dropgroup: xp_or_money
            drops:
              - drop: GOLD_INGOT/1-3/100%
                message: ["&3Oooo %q gold!","&3%q gold has dropped..","&3Grab %q gold."]
                flags: UNIQUE
              - drop: XP/25/100%
                message: ["&5Bonus xp!"]
                flags: UNIQUE
          - dropgroup: loot
            drops:
              - drop: WEB
                flags: UNIQUE
                message: ["&1Puncturing the abdomen of the arachnid reveals it's sticky web glands."]
              - drop: SPIDER_EYE
                message: "spidereye"
                quantity: 1-3
                flags: UNIQUE
              - drop: ANY_PICKAXE
                message: "pickaxe"
                flags: UNIQUE
              
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  12. Offline

    Hopium

    Zarius on my lunch break so i will be quick but essentially what i was aiming for was xp and money to be a global drop from all friendly/hostile mobs. but was also trying to get zombie's a pig zombies to have a chance to drop 1 of a set of armor and then if 1 of those items triggered to drop it would cancel the rest of the items in that exclusive bracket. therefore a zombie would always have a chance to get bonus xp/money plus a chance for a piece of armor independent of all the other drops. while disabling default drops so its doesn't drop undead flesh unless it was triggered by my drops for undead flesh. when i get off work i will look more into the dropgroups on bukkitdev, but from i understand from your post the setup with spider is it will only pull 1 drop from the dropgroup then null the rest and moveo n to the next group? so i could have like actual drop tables? like a group for the xp/money a group of armor and a group for tools/misc and group for vanilla drops? if this is correct i believe it will work better then the exclusive system.
     
  13. Offline

    durand1w

    Zarius

    Thanks for the reply.

    I'm wanting to make sure that if I define a custom drop for the Enderdragons that it still drops the enderdragon trophy egg, portal and experience. I'm hoping to add to the basic drop as well as add a 'dragon hoard' - gems, gold nuggest, and chance of enchanted armour (possibly the chainmail that is no longer craftable). Since this mob is rather unique I'm more concerned about altering it than the other drops i'm looking at.
     
  14. Offline

    Zarius

    Hopium

    Yup, that's essentially how it should work, if all the drops in the dropgroup are unique it'll pick one at random and ignore the rest then process the next dropgroup, etc.

    I didn't notice all the XP & Gold drops are the same - if you don't plan on varying them per creature you could add them to the ANY_CREATURE block:

    Code:
      ANY_CREATURE:
        - drop: NOTHING
     
        - dropgroup: xp_or_money
          drops:
            - drop: GOLD_INGOT/1-3/100%
              message: ["&3Oooo %q gold!","&3%q gold has dropped..","&3Grab %q gold."]
              flags: UNIQUE
            - drop: XP/25/100%
              message: ["&5Bonus xp!"]
              flags: UNIQUE
    
    If you did want to vary the quantities per mob I'd probably use YAML aliases (I'll post an example later).

    durand1w

    You can add "- drop: DEFAULT" to ensure that the normal drop occurs as well as the custom drops you add. An example of enchanted armor is "- drop: DIAMOND_ARMOR@!PROTECTION_FIRE#1". See this page for more info on enchantments.
     
  15. Offline

    sagethor

    Zarius
    Seems to be working fine. How does one use the POTION drop to drop specific types?
     
  16. Offline

    Zarius

    sagethor - I believe potions are defined by their damage value or "durability" (eg. POTION@8193 = potion of regeneration, short duration). See the Minecraftwiki page for more details on which damage values to use.
     
  17. Offline

    Celtic Minstrel

    Are you sure there's no way to get the location of the lure? The game considers it to be a projectile, so I imagine there would be some way to get the position, though it may not be easy I guess.


    Is it actually possible to have baby spiders?

    I personally prefer having the includes in one place, plus the flexibility it gives of not even needing an includes folder if I prefer to have my one includes file in the same folder as the main one. (That's a hypothetical situation; I don't actually use OtherDrops at the moment.)

    Can you use enchantments on wildcards? For example, ANY_TOOL@!SILK_TOUCH.
     
  18. Offline

    Zarius

    Celtic Minstrel - there might be a way to find the lure but I didn't really spend a lot of time on it.

    I don't think there's baby spiders as such but CAVE_SPIDER's are smaller than normal ones. I regards to baby cows, sheep, etc I haven't worked out how to drop these. There's a plugin out there that says they've worked out how to drop them but they haven't released that version yet.

    ANY_TOOL@!SILK_TOUCH wont work - guess it'll need some modification in the MaterialGroup class (and probably elsewhere too).
     
  19. Offline

    sagethor

    Alright, thanks. :)
     
  20. Yes, thats correct. With baby spiders i meant using cave spiders due to their size.
     
  21. Offline

    Zarius

    New pre-release (2.3 pre2)

    * only addition is data value "THIS", eg:

    Code:
      SHEEP:
        - drop: WOOL@THIS
      ANY_CREATURE
        - drop: MONSTER_EGG@THIS
      LOG:
        - drop: LOG@THIS
    
     
  22. I am assuming THIS refers to the type that is the source? A white sheep will drop white wool and a spider spawner will drop a spider egg etc.. ?
     
  23. Offline

    Zarius

    Yes, that's correct. Though I haven't tested mob spawners it should work. Monster eggs are a littledifferent in that they drop the same creature, not data.
     
  24. Zarius

    I know im not running the absolutely latest yet, and thus dont know if its already fixed, but incase its not. Im tossing it in here.

    Code:
    12:27:16 [WARNING] [OtherDrops:2.2-beta1] Error: unknown entity target (CraftEnderDragonPart) - please let the developer know.
    
     
  25. Offline

    Zarius

    Probably not fixed yet - I haven't played with EnderDragon's much, and haven't ever managed to kill one yet. I did notice though that they will trigger custom drops which will lag out the server with thousands of drops pretty quickly - I'll look into that.
     
  26. Offline

    Celtic Minstrel

    I think it's the setAge() function.

    Um what? Didn't I add that months ago?
     
  27. Offline

    Zarius

    Ah, it has to be of class "Animals" (and only for Chicken, Cow, MushroomCow, Pig, Sheep, Wolf) before I can use .setAge() or .setBaby() - cool.

    THIS: nope. We added drop: THIS (ie. for grass it'll drop grass) but only discussed the datavalue "@THIS". Didn't see any code to support it and it was considered an invalid data value - unless there was a commit you haven't pushed?
     
  28. Offline

    Hopium

    Zarius using this config i am getting odd drop behavior like it is ignoring the chances, and just dropping one thing from each table anyways if you load it up you will see all mobs drop one or the other of money or xp not based on chanced but on either one has to drop regardless of the chance.

    running the pre-release that added THIS and cb-r3
     
  29. Offline

    Zarius

    Hmm... I tested it and it seems to work fine for me. I think though that you were wanting loot _and_ xp or gold to drop, right? You've got some mob drops in groups and some not - you need to put all UNIQUE mob drops into a dropgroup because otherwise they override the gold/xp dropgroup. Eg:
    Show Spoiler
    Code:
        CREATURE_SPIDER:
            - drop: WEB
              chance: 10
              message: ["&1Puncturing the abdomen of the arachnid reveals it's sticky web glands."]
              flags: UNIQUE
            - drop: ANY_PICKAXE
              chance: 5
            - drop: SPIDER_EYE
              chance: 35
              quantity: 1-3
    
    should be
    Code:
        CREATURE_SPIDER:
            - dropgroup: loot
              drops:
                - drop: WEB
                  chance: 10
                  message: ["&1Puncturing the abdomen of the arachnid reveals it's sticky web glands."]
                  flags: UNIQUE
                - drop: ANY_PICKAXE
                  chance: 5
                - drop: SPIDER_EYE
                  chance: 35
                  quantity: 1-3
    


    Version 2.3-beta1 (2012/02/04) (download)

    * disable Enderdragon explosions (too dangerous - easy to cause server overload - will later enable via a config option)
    * fix IN_MOB_ARENA flag
    * More flexible aliases system - now ignores spaces, dashes and underscores (ie. goldhelm will match GOLD_HELM).
    * Revamp of main drop function - "exclusive" now removed but replaced with more powerful usage of UNIQUE flag, eg:
    Show Spoiler
    Code:
      # this config sets up two drop groups where the contents of each dropgroup are UNIQUE
      # basically this selects one drop at random from each dropgroup (ie. web & gold, OR web & XP)
        SPIDER:
          - dropgroup: xp_or_money
            drops:
              - drop: GOLD_INGOT/2
                flags: UNIQUE
              - drop: XP/25/100%
                flags: UNIQUE
          - dropgroup: loot
            drops:
              - drop: WEB
                flags: UNIQUE
              - drop: .....
    


    * Added "THIS" for datavals - eg:
    Show Spoiler
    Code:
      SHEEP:
        - drop: WOOL@THIS # will drop wool of same color as sheep
      LOG:
        - drop: LOG@THIS # drop same log as tree you are breaking
      ANY_CREATURE:
        - drop: SPAWN_EGG@THIS # drop an egg that spawns the creature just killed
    


    * support block level "exceptions", eg:
    Show Spoiler
    Code:
      ANYBLOCK except [FURNACE, WORKBENCH]:
        - drop: DIAMOND
    

    This may end up changing to a format of [ANYBLOCK, -FURNACE, -WORKBENCH]

    * improve stopmobfarm config and change DAMAGE_BURN to an alias for FIRE/FIRE_TICK/LAVA.
    * add alias "BLOCK_BREAK" for action "BREAK"
    * fix EXPLOSION_TNT & EXPLOSION_ANY tool, add EXPLOSION as an alias for EXPLOSION_ANY
    * only default tooldamage to 1 for blockbreak events (this was only meant to be a protection due to the need to cancel blockbreak events)
    * trim enchantment names so "SWORD@ench1, ench2" will work (previously the space after the comma would cause it to fail
    * fix NPE in PlayerInteractEvent
    * add distance safety check (to fix NPE) in PlayerInteractEntityEvent
    * Improved some log/debug messages

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

    Siguza

    Code:
    06:01:42 [WARNING] [OtherDrops:2.1.2] Error: unknown entity target (CraftFireball) - please let the developer know.
    06:07:06 [WARNING] [OtherDrops:2.1.2] Error: unknown entity target (CraftFireball) - please let the developer know.
     
  31. Offline

    Celtic Minstrel

    Ah, sorry, I got a bit confused there! :p

    This would require less parsing since the key would be a list, not a string, but you'd need to bypass the Configuration API by getting a Map from it, because the Configuration API only allows recognizes keys.
     

Share This Page