[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

    Yup... that's the second time I've tagged him - odd with no posts though.

    Sorken

    Not quite the same way other drops work. If you, for example, add a diamond drop (100%) to a zombie it will override the default and rotten meat will not drop. Currently that's the same if you drop money. I'll be changing that so that adding a money drop will not override the default (unless you put drop: nothing) and the rotten meat will still drop. Same thing with XP - it will not override the rotten meat (although it will clear any default XP drop).

    Minecraft wiki shows default xp drops on each of the creature pages if people are looking for it.
     
  3. Zarius
    Really? That sounds... bad. I mean if you specify a 100% drop shouldnt it drop 100% in addition to default drop (which most likely would be lower).
     
  4. Offline

    Zarius

    Sorken

    You need to clarify what type of drop you're talking about - money, xp or other?

    Eg.

    Code:
      ZOMBIE:
        - drop: DIAMOND/1/100%
    
    I do not expect the default drop to occur here (unless you add 'drop: default').

    Code:
      ZOMBIE:
        - drop: MONEY/1/100%
    
    And currently this also cancels the default drop. The new change is that money will not cancel the default drop (unless 'drop: nothing' is added)
     
  5. Offline

    Celtic Minstrel

    I'm not sure I approve of this change, since it makes the behaviour of drops inconsistent, but whatever.
     
  6. Offline

    Zarius

    I agree consistency is good but if a user writes "zombie: drop: xp/5" I don't believe they are expecting to override the default drop so it's a case where consistency is not necessarily the most intuitive answer.

    The other option is changing it so that no drops override default automatically (but that would break a lot of configs & current expectations).

    It's tricky to get the balance right.
     
  7. Zarius

    Normal drops. Why mess with default drops at all unless you state first that it should drop nothing and then add other drops?
     
  8. Offline

    zenvince

    Hi, and thanks for that awsome plugin, and I apologize in advance for my poor english level.
    I have a couple of questions for which I didn't find out any answer yet.
    First, I tried to figure out how to change cat's color (from a demand by my server's members), I tried this code for testing
    Code:
        CAT@RED_CAT:
            - action: RIGHT_CLICK
              tool: DYE@BLACK
              drop: CAT@BLACK_CAT
    This kinda works, a black cat is successfully dropped but it goes wild (and I didn't find a way to kill the original cat yet) Is there any way to get a tamed one instead of a wild one ? (I tried "drop: CAT@BLACK_CAT/TAMED" but doesn't seem to work)

    I'm also having issues with the "event: THUNDER" which, besides not being able to make thunder appear, breaks the associated drop itself.
    I'm using McMyAdmin v0.9.7.6 Personal edition with CraftBukkit version git-Bukkit-1.2.3-R0.2-b2060jnks (API version : 1.2.3-R0.2)

    Any clues ? Any reply would be welcome and much appreciated. Thanks !
     
  9. Offline

    Celtic Minstrel

    I was pretty sure that BLACK_CAT is tame by definition...?


    Also, thunder would probably have no effect unless it's raining. Assuming that "event: THUNDER" really does thunder and not lightning.
     
  10. Offline

    zenvince

    @Celtic_Minstrel

    Thank you for your answer.
    I was pretty sure too, but it appears that the cat which spawns is a BLACK_CAT untamed (it also appears to be the size of a WILD_OCELOT)
    Pretty fun though that's not what I wanna achieve :rolleyes:
    Also, is there a way I haven't found to kill/remove the original cat by this process ?
    Looks like it would need an " event: KILL " or maybe the use of another plugin in conjunction with " command: "/***" "

    Concerning the " event: THUNDER", I attempted to make a GIANT spawn at 1% "drop rate" when killing a zombie by RAIN or STORM weathers, and wanted thunder to come out at this exact moment, not lightning ( lightning is supposed to strike at the giant's death )
    I've put a " message: "test THUNDER" " in my parameters, but didn't show up even while I did it when it was actually raining. The only presence of the line "event: THUNDER" seems to simply break the whole thing.

    EDIT: In fact, whenever I use "event: THUNDER" , my server's log give me this :
    Code:
    [SEVERE] Error occurred while enabling OtherDrops v2.5.1 (Is it up to date?)
    java.lang.NullPointerException
        at com.gmail.zariust.odspecialevents.ThunderEvent.canRunFor(ThunderEvent.java:66)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.loadSimpleDrop(OtherDropsConfig.java:527)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.loadDrop(OtherDropsConfig.java:406)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.loadBlockDrops(OtherDropsConfig.java:390)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.loadDropsFile(OtherDropsConfig.java:330)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.loadDropsFile(OtherDropsConfig.java:349)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.loadConfig(OtherDropsConfig.java:232)
        at com.gmail.zariust.otherdrops.OtherDropsConfig.load(OtherDropsConfig.java:137)
        at com.gmail.zariust.otherdrops.OtherDrops.onEnable(OtherDrops.java:134)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:215)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:336)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:363)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:250)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:232)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:374)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:361)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:187)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:425)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
     
  11. Offline

    Zarius

    It's a matter of personal preference but OtherDrops started from the premise (for me, at least, based on the way the existing OtherBlocks worked) of defining drops to override the default drops - eg. stairs drop stairs rather than cobble. Other people are used to this action and/or prefer it (see some of the comments in a poll here).

    zenvince

    Re: event: THUNDER - I believe that should more clearly be named event: THUNDERSTORM as it just starts a thunderstorm (whereas event: lightning causes a lightning strike). Not sure about the nullpointerexception - I'll look into a fix for that in the next version.

    Re: redcat->blackcat That's an interested config, hadn't thought of that. Currently there's no way to kill/remove a mob - will look into that as a possible future feature.

    The cat drop isn't tamed yet (as in does not have an owner) - I'll look into a solution allowing both tamed/untamed cats.
     
  12. Offline

    zenvince

    @Zarius

    I just tried the event THUNDERSTORM as you stated above, which results in :
    Code:
    [OtherDrops:2.5.1] Unknown event type THUNDERSTORM; skipping...
    This feature isn't a must have to me, I can deal with the event STORM (occasionaly triggering THUNDER), but thanks for your consideration
     
  13. Offline

    Zarius

    Sorry, I meant that I need to go through the source code and rename THUNDER to THUNDERSTORM as that's what it does (starts a thunderstorm) and also fix that nullpointer error. Storm just starts rain without thunder.

    If you're looking for a lightning strike use "event: lightning".
     
  14. Offline

    zenvince

    Sorry if I misunderstood you :oops:
    As I mentionned a few posts earlier (my second post actually) I'm aware of the "event: LIGHTNING" since I use it when defeating the Giant. Thanks anyway. A thunderstorm was meant to appear at its spawn (Zombie's drop) for both adding kind of drama to the action and justifying the striking of the lightning (Giant's drop) :p
     
  15. Offline

    Zarius

    You should be able to get around it with the current version by using this:

    Code:
      ZOMBIE:
        - biome: [ALL]         # this should stop that nullpointerexception
          event: THUNDER@ON  # thunder by itself doesn't work at the moment, thunder@on
                # or use thunder@<duration> (eg. thunder@500 for 500 ticks of thunderstorm)
                # and thunder@off for stopping it
    
     
  16. Offline

    zenvince

    Zarius

    Thank you, "event: THUNDER@ON" with "biome : [ALL]" appears to be working fine, having problems with THUNDER@OFF now ( tested with"biome: [ALL]" and "weather: [ALL]")

    Edit: Nevermind, just an UNIQUE flag which was messing everything up ;)

    Edit #2: Having issues with "replaceblock" in 2.6-pre1

    My config :
    Code:
    OBBLESTONE_STAIRS:
            - tool: ANY
              drop: COBBLESTONE_STAIRS
            - action: RIGHT_CLICK
              tool: FLINT
              replaceblock: SMOOTH_STAIRS
              consumetool: 1
        COBBLESTONE:
            - action: RIGHT_CLICK
              tool: DYE@WHITE
              replaceblock: MOSSY_COBBLESTONE
              consumetool: 1
            - action: RIGHT_CLICK
              tool: FLINT
              replaceblock: STONE
              consumetool: 1
        MOSSY_COBBLESTONE:
            - action: RIGHT_CLICK
              tool: FLINT
              replaceblock: COBBLESTONE
              consumetool: 1
        SMOOTH_STAIRS:
            - tool: ANY
              drop: SMOOTH_STAIRS
            - action: RIGHT_CLICK
              tool: SULPHUR
              replaceblock: COBBLESTONE_STAIRS
              consumetool: 1
        98@0:    #SMOOTH_BRICK@NORMAL
            - action: RIGHT_CLICK
              tool: DYE@WHITE
              replaceblock: 98@1
              consumetool: 1
            - action: RIGHT_CLICK
              tool: SULPHUR
              replaceblock: 98@2
              consumetool: 1
        98@1:    #SMOOTH_BRICK@MOSSY
            - action: RIGHT_CLICK
              tool: SULPHUR
              replaceblock: 98@2
              consumetool: 1
            - action: RIGHT_CLICK
              tool: FLINT
              replaceblock: 98@0
              consumetool: 1
        98@2:    #SMOOTH_BRICK@CRACKED
            - action: RIGHT_CLICK
              tool: DYE@WHITE
              replaceblock: 98@1
              consumetool: 1
            - action: RIGHT_CLICK
              tool: FLINT
              replaceblock: 98@0
              consumetool: 1
    Server log's showing this :
    Code:
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {FLINT/1=true} on COBBLESTONE_STAIRS -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {INK_SACK@WHITE/1=true} on COBBLESTONE -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {FLINT/1=true} on COBBLESTONE -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {FLINT/1=true} on MOSSY_COBBLESTONE -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {SULPHUR/1=true} on STONE -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {SULPHUR/1=true} on SMOOTH_STAIRS -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {INK_SACK@WHITE/1=true} on SMOOTH_BRICK@NORMAL -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {SULPHUR/1=true} on SMOOTH_BRICK@NORMAL -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {SULPHUR/1=true} on SMOOTH_BRICK@MOSSY -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {FLINT/1=true} on SMOOTH_BRICK@MOSSY -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {INK_SACK@WHITE/1=true} on SMOOTH_BRICK@CRACKED -> 'UNSPECIFIED"
    2012-03-20 15:28:12 [INFO] [OtherDrops:2.6-pre1] Loading drop (null: failed or default drop): RIGHT_CLICK with {FLINT/1=true} on SMOOTH_BRICK@CRACKED -> 'UNSPECIFIED"
    This code is running fine in v2.5.1

    Regarding the renaming of event THUNDER to THUNDERSTORM, can I still use the data values @ON and @OFF ?
     
  17. Offline

    Zarius

    **Version 2.6-pre-release 2** - may be buggy, needs testing - please let me know of any bugs/issues - download here.

    Pre-2
    * fixed issue reading PLAYER targets.

    Pre-1 changes
    * Adds vault support for money drops.
    * XP & money drops no longer override default drop.
    * add settings for loot/xp/money_overrides_default to otherdrops-config.yml
    * ocelot/cats now support wild/tamed (cats tame by default, ocelots wild by default) - eg. ocelot@redcat\tamed (note, must be backslash, not forwardslash).
    * replacetool can now include a quantity (eg. replacetool: diamond/3 will take away replace current tool(s) in hand with 3 diamonds)
    * account for EnderCrystal in getEntityTarget() - currently does nothing with it (so EnderCrystal is not a valid target yet)
    * allow "tool: " to require a quantity (eg. "tool: dead_bush/2" requires two or more dead bushes to be held)
    * add 'delay: 1' if action = rightclick and replacetool is set (this avoids issue with tools being replaced by a water or lava bucket that then gets used).
    * fix npe in thunder event, rename thunder event to thunderstorm, default duration to 2 minutes

    zenvince

    Yes, data values haven't changed with thunderstorm.

    Don't worry about those error messages, it's just complaining because it can't find a drop parameter. I need to clean up the loading messages at some point. Do the replace blocks bits still work ok?

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

    zenvince

    Zarius

    They're working fine ingame. I also had to install Vault to make OtherDrops running (even if Vault itself crashed at startup)
     
  19. Offline

    Zarius

    zenvince

    Dang - I'll check out the dependency on Vault issue.

    @Anyone-else-using-2.6-pre2

    Same issues with Vault being required?
     
  20. Offline

    Celtic Minstrel

    This isn't really anything important, but my preference for this sort of thing would be:
    Code:
    overrides-default:
      loot: true
      xp: true
      money: true
    
    (Disregarding the actual settings; my point is about the format.)

    This means that related settings are kept grouped together, plus I prefer hyphens to underscores in general. But it's not particularly important or anything.
     
    Zarius likes this.
  21. Offline

    Zarius

    Celtic Minstrel

    No - that's quite a good point, thanks :)

    Release 2.6-pre3 (temp download here until BukkitDev approves the file)
    • fixes issues loading "default:" section of files,
    • fixes issue with trying to load vault when it's not there

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

    Mathew Alden

    Hi. I have a question...
    So, I noticed you were using item names in your example config. Can I use data values instead? Because I want a custom drop for 44:6 and I doubt that has a name...
     
  23. Offline

    Zarius

    Yeah, that should work as long as you use quotes, eg:

    Code:
    otherdrops:
      "44@6":
        - drop: diamond
    
    Or you can just use SLAB@6 (or even STEP@6).
     
  24. Offline

    Celtic Minstrel

    Why does everyone think there's a seventh type of slab when that's not true... :/
     
  25. Offline

    Mathew Alden

    Um... it is true...

    Why do you say it's not?
     
  26. Offline

    Celtic Minstrel

  27. Offline

    Mathew Alden

  28. Offline

    Celtic Minstrel

    "glitch" is equivalent to "doesn't exist".

    If you want to count glitches, there'd be eight. But glitches don't count, and there's only six.
     
  29. Offline

    KittenousBeast

    Good morning, I love your plugin.

    I'm running a MCPC server with the last stable build of Forge.
    The mods I have running are Redpower 2 4.e, Computer Craft 3.1, Ironchests 3.1, and Hot Air Balloons.

    The problem seems to be coming from Computer Craft and the Mining Turtle block breaking event - Here's the error message from the server log.

    Code:
    07:32:23 [SEVERE] Could not pass event BlockBreakEvent to OtherDrops
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:441)
        at dan200.turtle.shared.TileEntityTurtle.dig(TileEntityTurtle.java:748)
        at dan200.turtle.shared.TileEntityTurtle.updateCommands(TileEntityTurtle.java:1029)
        at dan200.turtle.shared.TileEntityTurtle.q_(TileEntityTurtle.java:926)
        at net.minecraft.server.World.tickEntities(World.java:1184)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:548)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:455)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.NullPointerException
        at com.gmail.zariust.otherdrops.listener.OdBlockListener.onBlockBreak(OdBlockListener.java:98)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
        ... 9 more
    
    This may or may not result in a client side crash - but at the very least results in a massive lagspike for anyone near the turtle that is breaking blocks. If this is something I need to fix in the configs, I'd really appreciate some help to get it fixed! Otherwise, this might be a bug or something? Thanks so much for your help, and great job on this awesome plugin!
     
  30. Zarius
    If im using any bukkit build later then 2120 i get damage on breaking blocks or killing monsters with custom drops. Has this been resolved in any of the later versions?
     
  31. Offline

    user_90563788

    Great plugin. Is there a way to use MONEY@STEAL to steal a percentage of the player's money, rather than a set amount? I tried putting a % sign but got an error. I noticed you can do this with MoneyDrops but since I don't need to see the money drop, I only need to steal a percentage, I was wondering if it can be done using just OtherDrops.
     

Share This Page