[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

    Dropgroups can also be handy - eg:

    Code:
      SPIDER:
        - dropgroup: night
          time: NIGHT
          drops:
            - drop: STRING/10%
            - drop: WEB/10%
    
        - dropgroup:day
          time:DAY
          drops:
            - drop: AIR
            # add any more day drops if you wanted, etc....
    
     
  3. Offline

    Undectectable

    3 [INFO] [SpawnMob] Version 1.9.8 disabled.
    2011-09-22 12:00:44 [INFO] mcMMO was disabled.
    2011-09-22 12:00:44 [SEVERE] Could not load 'plugins/ModDamage.jar' in folder 'plugins':
    while parsing a block mapping
    in "", line 1, column 1:
    Aliases:

    got that error anyone know how to fix? thanks
     
  4. Offline

    jkmerlin

    Works great, other than one error... I'm still trouble shooting it but i've narrowed it down to
    And the error is
    It may be more misspelling or something, any advice?

    Edit; Looks like diamond is actually an ore, i'll fix that. Never mind then
    Edit again; nope, still doesnt work
    Edit for the last time; So the \t is a tab, i replaced it with spaces and got
    Am i supposed to put something between them other


    Fixed it, PICKAXE not just PICK and changing the order for some reason. Cool plugin though, this should add some fun to my server
     
  5. Offline

    Zarius

    The looks like an error with ModDamage, not OtherDrops.
     
  6. Offline

    RugRats

    Lol I was going to post.. wrong plugin post buddy lol
     
  7. Offline

    derekmiles

    any progress on fixing the arrow problem? also I just wanted to say thank you for spending your time on this project good job:)
     
  8. Offline

    Singso

    Works great for me now :)
    Keep up the good work!
     
  9. Offline

    Undectectable

    sorry this error
    2011-09-22 12:20:15 [SEVERE] Could not load 'plugins/OtherDrops.jar' in folder 'plugins':
    java.lang.reflect.InvocationTargetException
     
  10. Offline

    Shadowsquire

    I have an interesting problem. My config is setup like this
    Code:
    CREATURE_ZOMBIE:
            - drop: MONEY
              quantity: 2-10
              message: You got %q dollars off that Zombie!
    But when I kill the zombie, instead of getting "3 dollars" or "4 dollars" I get "5.215645578945 dollars" or some crazy decimal like that. How can I make the numbers round to a decimal place?
     
  11. Offline

    Celtic Minstrel

    @Shadowsquire – I recently pushed a change that makes this an option in the main config (the one where you set verbosity and such), so hopefully Zarius will pull and build that version soon. It will allow you to specify how many decimal places you want to round to.
     
  12. Offline

    Piercing Goblin

    Is there any way to make it so when a boat crashes it still drops a boat?
     
  13. Offline

    toxycated

    Went afk for a bit and came back to a wall of text of the following

    14:14:59 [WARNING] [OtherDrops:2.0-beta6] Error: unknown entity target (CraftFal
    lingSand) - please let the developer know.
     
  14. Offline

    kahlilnc

    Code:
    2011-09-24 04:00:22 [INFO] [OtherDrops:2.0-beta6] Events node created.
    2011-09-24 04:00:22 [INFO] [OtherDrops:2.0-beta6] Loading file: otherdrops-drops.yml
    2011-09-24 04:00:23 [WARNING] [OtherDrops:2.0-beta6] Unrecognized tool; skipping.
    2011-09-24 04:00:23 [INFO] [OtherDrops:2.0-beta6] Using Bukkit superperms.
    2011-09-24 04:00:23 [INFO] [OtherDrops:2.0-beta6] OtherDrops loaded.
    That is what I get. I do not think it harms anything but do not know what the tool is???

    Code:
    otherdrops:
      CREATURE_ZOMBIE:
        - tool: ALL
          toolexcept: GOLD_SWORD
          drop: CREATURE_ZOMBIE
          quantity: 1-2
          chance: 30
        - tool: ALL
          toolexcept: GOLD_SWORD
          drop: CREATURE_SKELETON
          quantity: 1
          chance: 10
        - tool: ALL
          toolexcept: GOLD_SWORD
          drop: CREATURE_GIANT
          quantity: 1
          chance: 0.5
      BOOKSHELF:
        - tool: ANY_AXE
          drop: BOOKSHELF
      WOOD_STAIRS:
        - tool: ANY_AXE
          drop: WOOD_STAIRS
      COBBLESTONE_STAIRS:
        - tool: ANY_PICKAXE
          drop: COBBLESTONE_STAIRS
      BOAT:
        - tool: ALL
          drop: BOAT
      GLASS:
        - tool: ANY
          drop: GLASS
        - tool: AIR
          drop: NOTHING
          damageattacker: 1-2
          message: "Ouch! Breaking glass with your bare hands hurts."
          chance: 50
        - tool: ANY
          toolexcept: GOLD_PICKAXE
          drop: NOTHING
          exclusive: 1
          chance: 10
          message: "Aw, the glass broke..."
      LEAVES@GENERIC:
        - tool: ALL
          drop: APPLE
          chance: 2
        - tool: ALL
          drop: STICK
          chance: 3
        - tool: ALL
          drop: LEAVES
          chance: 1
          color: GENERIC
        - drop: APPLE
          chance: 0.4
        - drop: STICK
          chance: 0.4
        - drop: LEAVES
          chance: 0.4
          color: GENERIC
      LOG:
        - tool: GOLD_AXE
          drop: CHARCOAL
          chance: 70
      SAND:
        - tool: GOLD_SHOVEL
          drop: GLASS
          chance: 50
          damagetool: 2
      IRON_ORE:
        - tool: GOLD_PICKAXE
          drop: IRON_INGOT
          chance: 40
      GOLD_ORE:
        - tool: GOLD_PICKAXE
          drop: GOLD_INGOT
          chance: 20
      GLOWSTONE:
        - tool: GOLD_PICKAXE
          drop: GLOWSTONE
          chance: 30
      ICE:
        - tool: GOLD_PICKAXE
          drop: ICE
          chance: 40
      GRASS:
        - tool: GOLD_HOE
          drop: GRASS
          chance: 20
     
  15. Offline

    Celtic Minstrel

    I made that error message more useful in a recent commit; it won't show you what the tool was, but it'll at least show you the block it was in.

    That said, uh... actually I don't see any wrong tools in your config. Huh.

    Not sure. Might be possible, might not. I can look into it at some point.
     
    kahlilnc likes this.
  16. Offline

    slimpyman

    when is it best to use ANY and when to use ALL? all means like if a mob drops off a cliff, and any means any tool? hmm...
     
  17. Offline

    Zarius

    All and any are the same :)

    Will that work with 0 decimal places (integers)?

    Was there more to that error?

    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

    It should, yes. Might even work with negatives (eg -1 to round to the nearest 10).
     
  19. Offline

    Shadowsquire

    That would be great. Thanks! It still works fine the way it is, just it looks hilarious when it pops up in chat :p
     
  20. Offline

    p000ison

    This plugin works with the old Permissions 3 (Yeti) AND
    The new PermissionsBukkit, or?(http://forums.bukkit.org/threads/ad...2k-official-default-groups-plugin-1185.26785/)

    So I addet in the Otherdrops Config:
    COAL_ORE:
    - tool: ALL
    drop: NOTHING
    permissions: coal

    Then I added the Node in permission3 oder the newer one.... (otherblocks.custom.coal)
    So everyone who have the node otherblocks.custom.coal doesnt get coal, right?
    BUT:
    It doesnt work. The node havent any effect....

    Other things I tryed:

    COAL_ORE:
    - tool: ALL
    drop: NOTHING
    permission: coal
    OR:
    COAL_ORE:
    - tool: ALL
    drop: NOTHING
    permissions: otherblocks.custom.coal

    I also tryed the permission Plugins: PermissionsEx and bpermissions.
    In the console there is always: [INFO] [OtherDrops:2.0-beta6] Using Bukkit superperms.
    But I dont think that it hooked into it. Because this is also showing if I havent installed Permissions.
    And when I've turned Yeti mode on. There is no information.
    Now can somebody show me a part of his Permissions Cofig and which version you use and the otherdrops configs?
    I dont know what is false. A few weeks before or with the version 1.x all works perfekt.

    Sry for my bad english...:'(
    Please can someone help me??:'(:oops:
     
  21. Offline

    Undectectable

    PLAYER:
    - drop: CREATURE_ZOMBIE
    chance: 50%

    CREATURE_COW:
    - drop: LEATHER
    chance: 30%
    - drop: RAW_BEEF
    chance: 10%
    - drop: AIR
    chance: 60%

    CREATURE_PIG:
    - drop: RAW_PORKCHOP
    chance: 10%
    - drop: AIR
    chance: 90%

    CREATURE_SHEEP:
    - drop: WOOL
    chance: 30%
    - drop: AIR
    chance: 70%

    CREATURE_CHICKEN:
    - drop: FEATHER
    chance: 30%
    - drop: RAW_CHICKEN
    chance: 25%
    - drop: AIR
    chance: 45%

    CREATURE_SPIDER:
    - drop: WEB
    chance: 10%
    - drop: STRING
    chance: 10%
    - drop: AIR
    chance: 80%

    Im trying to make it so that, for example with the chicken-
    Theres a 30% chance for a feather
    or 25% chance for raw chicken
    or 45% chance of nothing droping. Please help.
    Thanks
     
  22. Offline

    Celtic Minstrel

    Two things you can do.

    1. Use the "exclusive" parameter. If you add "exclusive: true" to each of the drops, only one of them can occur.
    2. Use the exclusive drop syntax with embedded percentages.

    An example of method 1:
    Code:
      CHICKEN:
      - drop: FEATHER
        chance: 30%
        exclusive: true
      - drop RAW_CHICKEN
        chance: 25%
        exclusive: true
      - drop: NOTHING
        # don't include the chance, because if the roll fails the default would drop
        # NOTHING doesn't mean that nothing drops, only that this element of the list isn't defining something to drop
        exclusive: true
    
    And an example of method 2:
    Code:
      CHICKEN:
      - drop: {FEATHER/30%, RAW_CHICKEN/25%}
      # Don't need the air drop
    
    Note that each chance is rolled separately, so the second example means that first it rolls to see if a feather drops (with a 30% chance). If the roll succeeds, the feather drops and it ends there. If the roll fails, it rolls to see if raw chicken drops (with a 25% chance) and possibly drops the raw chicken. I haven't done the math, so I'm not sure if that's equivalent to the single-roll scenario that you seem to be expecting.
     
  23. Offline

    Kamilio

    I use this plugin with Mo's Creatures SMP Mod, and everything is working fine, but whenever I attack a monster from the mod, I get this error.

    I know you probobly haven't delt with this before, but is there anything I could do to make it stop saying that? I assume it's saying that because I'm hitting a mob not recorded in OtherBlock's database.

    Code:
    21:17:25 [SEVERE] Could not pass event ENTITY_DAMAGE to OtherDrops
    java.lang.NullPointerException
            at com.gmail.zariust.common.CommonEntity.getCreatureData(CommonEntity.ja
    va:53)
            at com.gmail.zariust.otherdrops.subject.CreatureSubject.<init>(CreatureS
    ubject.java:41)
            at com.gmail.zariust.otherdrops.event.OccurredDropEvent.getEntityTarget(
    OccurredDropEvent.java:424)
            at com.gmail.zariust.otherdrops.event.OccurredDropEvent.<init>(OccurredD
    ropEvent.java:124)
            at com.gmail.zariust.otherdrops.listener.OdEntityListener.onEntityDamage
    (OdEntityListener.java:59)
            at org.bukkit.plugin.java.JavaPluginLoader$61.execute(JavaPluginLoader.j
    ava:670)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:338)
            at net.minecraft.server.EntityHuman.d(EntityHuman.java:710)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:919)
            at net.minecraft.server.Packet7UseEntity.a(SourceFile:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:465)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:375)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
     
  24. Offline

    Celtic Minstrel

    It's as you said, OtherDrops doesn't know about the custom mob. I'm afraid there's not really anything we can do about that at the moment, except silencing the error.
     
  25. Offline

    Undectectable

    In fact does anyone have an example config i can have?
    thanks

    And an example of method 2:
    Code:
      CHICKEN:
      - drop: {FEATHER/30%, RAW_CHICKEN/25%}
      # Don't need the air drop
    
    Note that each chance is rolled separately, so the second example means that first it rolls to see if a feather drops (with a 30% chance). If the roll succeeds, the feather drops and it ends there. If the roll fails, it rolls to see if raw chicken drops (with a 25% chance) and possibly drops the raw chicken. I haven't done the math, so I'm not sure if that's equivalent to the single-roll scenario that you seem to be expecting.[/quote]

    I tried this and it hasnt worked, is there any chance you can take a look.
    CREATURE_COW: {LEATHER/25%, RAW_BEEF/10%}

    CREATURE_PIG: {RAW_PORKCHOP/10%, COOKED_PORKCHOP/2%}

    CREATURE_SHEEP: {WOOL/25%, DIRT/5%}

    CREATURE_CHICKEN: {FEATHER/30%, RAW_CHICKEN/25%}
    Basically i want the chicken to have a 45% chance to drop nothing, a 30% chance for a feather and 25% for a raw chicken. THanks

    I havent edited any config. Do i need to? iv only edited the drops file

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

    Celtic Minstrel

    @Undectectable – Mind editing your post so that my quote is actually in a quote box? :)

    Anyway, let me explain what I believe you want and why OtherDrops cannot do it (at least at the moment). As I understand it, you want chicken to drop one of three things: feather, raw chicken, or nothing. This is possible with OtherDrops; however, you also want to control the distribution of those things. In essence, you want us to generate a number from 1 to 100, and make the chicken drop a feather if it's less than or equal to 30, or raw chicken if it's greater than 75. In other words, we roll the dice once, and the outcome determines what drops; a single roll governs a whole set of drops.

    However, that's not what OtherDrops currently does when faced with something like {FEATHER/30%, RAW_CHICKEN/25%}. Instead, it first rolls to determine which drop to consider. In this case, there are two drops, so that's equivalent to flipping a coin. Then, it rolls a percentage to determine whether the drop actually occurs, so if it selected FEATHER it would then have a 30% chance of dropping it and a 70% chance of not dropping anything; if it selected RAW_CHICKEN it would have a 25% chance of dropping it and a 75% chance of dropping nothing. So, doing the math, you'll find that the overall chance of dropping a feather is actually 50% x 30% = 15%; the chance of dropping raw chicken is 50% x 25% = 12.5%, and the chance of dropping nothing is 50% x 70% + 50% x 75% = 35% + 37.5% = 72.5%.

    (Someone correct me if you find I'm wrong; I haven't done probability calculations for awhile. Note that these are percentages, so it's really 0.5 x 0.25 and so forth; that's why 50% x 30% didn't give 1500%.)

    I imagine that, knowing this, you could do the math and assign percentages so that the overall percentage turns out to be exactly what you want. Of course, that's easier said than done for many people. We might consider adding native support for distributions if we can think of a good way to notate it, but at present that's looking unlikely. Changing the {} notation to mean distribution is not an option since it would undermine its other use, which is to give a list of items and randomly choose one from the list.
     
    Undectectable likes this.
  27. Offline

    Undectectable

    ahhh great thanks for this. Thats really helpful
     
  28. Offline

    Celtic Minstrel

    After some thought, I realized that there is a way to do it that falsifies this statement. That is, it can be made to work so that if you have percentages it's a distribution, and if you don't have percentages it behaves as the normal "select a random item from the list", without having two separate cases. Of course, having some with percentages and some without may cause unexpected behaviour, but why would anyone do that? ;)
     
  29. Offline

    Zarius

    Was just thinking this and noticed you've posted it already :) I don't think we need to worry about mixed use, i'm still trying to think of a better way but nothing yet.
     
  30. Offline

    dyrnwyn

    Any word on this push? Having currency drop up to 7 decimal places is something my players poke me about regularly. :)
     
  31. Offline

    Celtic Minstrel

    If you're adventurous, you could clone my github OtherBlocks repository and build it yourself. If not, I believe we're planning to have a non-beta release this weekend.
     

Share This Page