[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

    Motumbo

    No I have not. It's not going to end my day if apples dont drop. I have fish and pork. :) But it is a feature I would like. Maybe try golden_apples 100% also to see if those are working.
     
  3. Offline

    Zarius

    I can confirm that apples were definitely working in the past and I'll sort out any issues with them - OtherBlocks goal is to drop anything, anyhow :D
     
  4. Offline

    Fokson

    I wanted to help you fix this leaf problem, because at first I noticed that it almost seemed like the outer-most layer of leaves on a tree was the only one that produced the custom drops, but then when I tried it on another tree it failed to yield the same result. I'm completely stumped, even though I have apples set to drop from a leaf block when destroyed with any tool 100% of the time, it seems to be COMPLETELY random. The only potentially useful piece of information I can give is that other drop-modifying plugins, such as "DropEdit", are also having the exact same problem, so it seems more likely that it is a 1.6 / bukkit 860+ problem rather than a problem with your plugin.

    Also, question. If I set 'tool' to FIRE, will it produce a custom drop when the block burns, like say if I set leaf to drop charcoal when destroyed with tool FIRE, or do you need to program something totally different for that / it's already there and I failed to rtfm close enough? XD
     
  5. Offline

    Zarius

    Yeah, was wondering if it was a bukkit bug as the code if fairly simple and just passes the apple material to 'dropitemnaturally'.

    Will try it with the latest craft bukkit build when I get a chance.
    The fire thing sounds cool, don't think it can do that yet but will add to the todo list.

    Ok, there's a bug with the leaves due to the way data is set (eg. data value 1 is a spruce leaf, but it's sometimes 9 when the leaf needs to be checked for decay). Will update the code and release a new build soon.

    New update (0.7.7z) - fixed the issue with "LEAVES" drops and added the ability to send the player a message upon the drop ("message:" option) - this can take just a single message or a list of messages to select from at random. An example is:

    Code:
            LEAVES@GENERIC:
                - tool: ALL
                  drop: APPLE
                  chance: 10
                  message: Oh wow, another apple.
                - tool: ALL
                  drop: GOLDEN_APPLE
                  chance: 0.5
                  message: ["Wow, a golden apple!", "It's your lucky day...", "Gold! Gold!"]
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  6. Offline

    grinch843

  7. Offline

    sagethor

    @Zarius

    Yet another annoying question! I know, I know, but there's so much this plugin can do! It's replaced several of my other plugins, like MobBounty. Are saddled pigs considered different from regular pigs?

    As in, is it possible to have saddled pigs drop saddles, but regular pigs do not? Thanks again, and I must say I love this plugin.
     
  8. Offline

    Motumbo

    I also cannot get milk buckets to drop either.
     
  9. Offline

    Zarius

    Using MILK_BUCKET?

    Will have to test for a saddle separately but this should be doable, was thinking of making CREATURE_PIG_SADDLED, CREATURE_PIG_UNSADDLED and a synonym CREATURE_PIG which matches both.

    Glad you like the plugin - most of the credit goes to Cyklo and Celtic Minstrel - a couple of times now I've thought of a new feature, gone into the code and realised it's already there :D
     
  10. Offline

    Motumbo

    Yes. I am using MILK_BUCKET
     
  11. Offline

    Zarius

    Hmm... will need to do some testing tonight to see what's up with that.
     
  12. Offline

    TheTennessee

    Question, why can't we just use the data values for items? This seems insanely confusing with names for everything.
     
  13. Offline

    Zarius

    You mean just the numbers? That's possible for data values (eg. instead of LEAVES@GENERIC you can use LEAVES@0). It should be possible to pass the raw number along too with a couple of changes, will look into it.

    There are a lot of special values that you can't use a number for though (as there is no matching data value) - eg. CREATURE_PIG_UNSADDLED, SPECIAL_LEAFDECAY, ANY_PICKAXE, DAMAGE_FIRE, etc.

    Personally I find the numbers very confusing and have to look them up all the time. When writing values I sometime have to look up an enum value (the names) but usually remember them and never forget what they are upon reading them.

    Motumbo - I just tested a drop with MILK_BUCKET (copied your config and bumped the chance up to 100%) and it worked fine - have you tried it with a 100% chance?

    Ok, I've released a beta of the version with Celtic Minstrels changes imported. Vehicle destruction seems to work fine. Painting destruction works but will still always drop a painting and wont distinguish between tools (use ALL).

    There is experimental water damage but this can break your server if you enable it (add "enableblockto: true" just below priority and you'll get a warning in the log that it is enabled). Use carefully, setting it to replace water with items can chew through to the bottom of the map and spawn thousands of items.

    Code:
    verbosity: normal
    priority: lowest
    enableblockto: false
    
    otherblocks:
    # fix the boat drop, with a bonus egg if you use a spade
            BOAT:
                - tool: ALL
                  drop: BOAT
                - tool: ANY_SPADE
                  drop: EGG
                  message: Egg!
    # unfix minecarts drops :D
            MINECART:
                - tool: ALL
                  drop: IRON_INGOT
                  quantity: 3
    # paintings drop eggs?! (and still a painting too)
            PAINTING:
                - tool: ALL
                  drop: EGG
    
    # experimental water damage (DANGEROUS - disabled above "enableblockto")
    # supposed to allow you to change the drop if a torch is destroyed by water, doesn't work yet)
            TORCH:
    
                - tool: DAMAGE_WATER
                   drop: EGG
    
    # WARNING: this one below chewed through my map :D
            WATER:
    
                - tool: DAMAGE_WATER
                   drop:DIAMOND
    
    @sagethor
    Looked into the pigs/saddles a little and still doable but a bit tricky - working on it.

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

    TheTennessee


    I find numbers easier. I had another mod that used #defines (enums) like that, and I had to post, why does CHAIN_HELM not work? Well... I was then told, oh, the reason why it didn't work is, that person named it CHAINMAIL_HELM, even though the name of the item in game is chain helm. So... I do prefer numbers. Less margin for error.
     
  15. Offline

    Motumbo

    I just updated to the new version, but apples are still not dropping for me.
     
  16. Offline

    Celtic Minstrel

    I believe you can use DYE instead of INK_SACK though.
     
  17. Offline

    Zarius

    That's true but you should also note that neither myself nor Cyklo (original author) created these names - these are the official Bukkit enum values. I have considered adding aliases so like you say - both CHAIN_HELM and CHAINMAIL_HELM would work fine (and perhaps even CHAINHELM) - Cyklo preferred not to add aliases but I think that a few extra can make it a lot more user friendly and cut down on the questions as per your example.

    Currently the system doesn't pass numbers through for the materials (don't shoot me, I've only just taken over the plugin :D) but will see if that can be done for those that prefer numbers.

    Odd - can you post that bit of the config again (is it the same as the previous one?) And which CraftBukkit are you using? I tested it just then with RB860 and this following code and it drops apples every time:

    Code:
            LEAVES@GENERIC:
                - tool: ALL
                  drop: APPLE
                  chance: 100
                  message: Oh wow, another apple.
    
    Very true. I'm thinking of taking up your idea of having a LAPIS alias (or LAPIS_LAZULI) too.
     
  18. Offline

    Celtic Minstrel

    No, if you set the tool to FIRE, then you would get that drop if you're holding a fire block in your hand while you mine.

    Distinguishing between tools should be doable, using a system similar to what is done for mobs.


    Ah, it doesn't work? What happens instead, then?

    I think what you should do is disallow DAMAGE_WATER as an option for WATER or STATIONARY_WATER.

    You should use the data portion for this — CREATURE_PIG, CREATURE_PIG@SADDLED, CREATURE_PIG@UNSADDLED. Similarly for creepers — CREEPER, CREEPER@POWERED, CREEPER@UNPOWERED. You could also do wolves — WOLF, WOLF@ANGRY, WOLF@TAME. This matches the way sheep are handled.
     
  19. Offline

    Zarius

    @Celtic Minstrel
    Sorry about that - meant to send you a message but was trying up the test build just past midnight and wanted to quickly post it before heading off to sleep. Finally worked out how to pull your changes and merge them into my fork :)

    Unfortunately paintings do not trigger a "onEntityDamage" event (tested it with a few debug messages). Still thinking about a way to work around this.

    Nothing at all (normal torch drop). I played with a few debug messages in the "blockTo" event but didn't have much time to work on it.

    Yeah, might need to do that :D Still need to work out why it's doing what it's doing.

    I agree, actually started working on it this way last night - I think I'm almost there. Didn't think of creepers & wolves - will add them.
     
  20. Offline

    Motumbo

    Same config as before. bukkit 860
     
  21. Offline

    Zarius

    Not sure what the problem is :( Works fine here. Perhaps try a simple config with just the following:

    Code:
            LEAVES@GENERIC:
                - tool: ALL
                  drop: APPLE
                  chance: 100
                  message: Oh wow, another apple.
    
     
  22. Offline

    igmikey

    i have the plugin set up but for some reason only myself and other admins can get the blocks to drop the modifired items, regular players get basic drops. is there some kind of permissions i need to add?
     
  23. Offline

    Zarius

    Yes, you need to add the otherblocks.active permission. Might set it up differently so new installs are active by default.

    New version released:

    Version 0.8.0z (2011/06/23)

    • allow separate drops for CREATURE_PIG@SADDLED, CREATURE_PIG@UNSADDLED; CREATURE_WOLF@NEUTRAL, CREATURE_WOLF@TAMED, CREATURE_WOLF@ANGRY; CREATURE_CREEPER@UNPOWERED, CREATURE_CREEPER@POWERED.
    • added "time" condition to limit a particular drop to only day or night

    Sorry guys - 0.8.0 was broken slightly - time condition was not optional. Version 0.8.1 fixes this.

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

    Motumbo

    so 8.1 is out then? :)
     
  25. Offline

    Zarius

    Yes, updated the top post last night. I recommend updating.
     
  26. Offline

    Legolas75893

    Bump for PLAYER :3

    If not too much trouble, maybe certain names as well? I want to drop a map when I die :3
     
  27. Offline

    Zarius

    Names is planned, groups too. Partial player drop code is in the source but haven't finished it yet.
     
  28. Offline

    Legolas75893

    Sweet :D
     
  29. Offline

    Celtic Minstrel

    Much as I think having player-specific drops is totally pointless, if you want to do it then I'd use PLAYER@<name>.
     
  30. Offline

    Legolas75893

    Pointless, but a nice feature.
     
  31. Offline

    Zarius

    I agree, it's a little frivolous but not too hard to do and we're already checking "onEntityDeath". Was thinking of the datavalues (PLAYER@<name>) but was stymied by the fact that the data values are represented internally as numbers. I think I've found a way around that though.

    Was also thinking about players by group (rather than name) perhaps PLAYERGROUP@<group> but "PLAYERGROUP" by itself is pointless. PLAYER!KNIGHT perhaps (not as readable).

    An a different note a player on my server suggested different drops for "spider-jockeys" - perhaps a "mounted" condition:

    Code:
            CREATURE_SKELETON:
                  # Skeletons riding a spider will drop a diamond
                - tool: ALL
                  drop: DIAMOND
                  mounted: CREATURE_SPIDER
    
    Also looking into adding two new tool synonyms - DAMAGE_PLAYER (tools, air - hmm, also needs to be any block/item eg. if the player kills a mob with an apple) and DAMAGE_ENVIRONMENT mainly to make it easier to nerf mob farms. Perhaps easier to implement a NOT parameter and say tool: NOT DAMAGE_ENVIRONMENT (and alias DAMAGE_PLAYER to this).
     

Share This Page