[INACTIVE][ADMIN/GEN] DropEdit v1.4.4 - Get different drops when destroying blocks [818]

Discussion in 'Inactive/Unsupported Plugins' started by NuxlyStardust, Apr 1, 2011.

  1. Offline

    NuxlyStardust

    DropEdit - Get different drops when destroying blocks
    Version: v1.4.4 (05/21/2011)
    Tested on: 798


    This is my first plugin. It allows you to define what your players get when
    they destroy certain types of blocks with a given tool.

    A good use for it is to allow your players to get sponge or nether blocks
    without having to use portals.

    This plugin was inspired by Jerry's NetherBlocks. I wanted the ability to
    add more blocks without having to edit the code every time. If you only want to use blocks from the Nether on a server where it can't be accessed, I recommend you to use his plugin instead, which will be more lightweight as its use is more specific.

    I would like to thank sk89q for his help, and all of you for your support and for reporting bugs.

    Features:
    • Make anything drop from broken or burned blocks, or decaying leaves.
    • A random number of items can be dropped.
    • You can define what percentage of chance players have to get a certain item.
    • Support for wool color and dye type.
    • Support for Permissions.
    • Support for CraftbukkitUpToDate.
    • Compatible with WorldGuard.
    How to configure:
    All details are given on the Wiki. A sample config file is joined with the plugin.

    Example:
    Code:
    items:
        GlowstoneDust:
            id: 348
            min: 1
            max: 3
            chance : 100
            groups:
                - *
    
    break:
        '2':
            '284':
                - GlowstoneDust
    With this setup, if you destroy (break) a grass ('2') block with a
    gold shovel ('284'), you will always (chance: 100) get
    1 to 3 (min: 1; max: 3) of glowstone dust (id: 348).

    For each item, only the "id" key is required, all other are optionals.

    Event
    The event here is "break". You can also use "burn", and "decay". These last two don't require a tool, so the list of items must appear in the block's section.

    Event > Block
    The block here is '2'. You can set it to '*', to refer to any block.
    You can also restrict the event to certain damage value by separating the two values with a comma. For example, '35,11' is a blue wool block.

    Event > Tool
    If you set the tool to * (or '*', both will work), the specified item will be dropped regardless of the tool used to destroy the block.
    Just like with the block, you can set a damage value.

    Item > Durability
    "durability" is optional (Default: 1). It allows you to select the wool color of type of dye
    you want.

    Item > Groups
    "groups" is optional (Default: '*'). It allows to define custom drops that will apply only for given groups. You need the Permissions plugin for that. This feature has been tested on Permissions 2.5.5.
    If Permissions is not installed, this field will be ignored.
    A list is expected, so you should use the list notation (as showed in the example above) even if you want to specify only one group.

    Item > Message
    "message" is optional (Default: none). It allows you to define a message that will be sent to the player. I strongly recommend that you use it only for very rare items, and only for the "break" event. Otherwise, the chat will overflow with messages from the plugin.

    Download:
    Important: The configuration file structure has changed in v1.4.0, do not forget to update your config.yml file.

    Latest version - Source Code - Wiki
    Old versions: 1.4.3 - 1.4.2 - 1.4.1 - 1.4.0 - 1.3 - 1.2 - 1.1

    Permissions Plugin

    Getting help & reporting problems:
    I 'll be glad to help you if you're having difficulties using my plugin, just post your questions in this thread.
    I will be able to help you faster if you provide the following:
    • A precise description of your problem, and explanations on what you are trying to do.
    • Your config file (if it is too long to post here, use codepaste.net).
    • A quick list of the other plugins you are using. Certain problems can be caused by conflicts between plugins.
    • Any particular output of my plugin visible in the logs (exceptions or other messages).
    Before you post, make sure that you are using the latest version of my plugin. The most recent version is indicated at the top of this post. I can't offer support for old versions. Also check that you are using the Bukkit's latest recommended build.

    Known Issues:
    • You will not always get items from burning blocks because they may be destroyed by the fire.
    • Exceptions will be thrown if the Permissions config file doesn't contain any group. This is a problem in the Permissions plugin, I can't do anything about it.
    • You can't use it to get spawners when you break them. If you need to work with spawners, I suggest CreatureBox.
    Todo:
    I can't tell for sure when the next version will be available.
    • iConomy support
    Information for developers:
    Used events: BLOCK_BREAK (High), BLOCK_BURN (High), LEAVES_DECAY (High)
    This plugin will not cancel any event.
    You can simulate any of these events using the appropriate methods in the plugin class (breakBlock, burnBlock, blockDecays).

    Changelog:
    Version 1.4.4 (05/21/2011)
    • Added "message" parameter, be careful with it (Requested by m5k).
    Version 1.4.3 (05/05/2011)
    • Fixed potential compatibility problem with the next versions of WorldGuard (thanks to sk89q)
    • Added methods to the main plugin class to allow other plugins to interact with DropEdit.
    Version 1.4.2 (05/02/2011)
    • Fixed compatibility problems with WorldGuard (Reported by JacKlink01).
    • Fixed potential compatibility problems with other plugins, Residence is likely working now.
    Version 1.4.1 (04/27/2011)
    • Fixed a bug that caused the Minecraft client to crash if the config file contained invalid YAML syntax. Yes, really.
    • Works with 733.
    Version 1.4.0 (04/24/2011)
    • Changed config file structure.
    • Added leaves decay event.
    • Added ability to restrict blocks and tools to a certain damage value.
    • Added support for CraftbukkitUpToDate (will be ready soon).
    • Added properly working way to make multiple items drop for the same event.
    • Tested on 684. Works.
    • Created a Wiki: https://github.com/NuxlyStardust/DropEdit/wiki
    Version 1.3.4 (04/14/2011)
    • Updated for 677.
    Version 1.3.3 (04/12/2011)
    • Fixed a bug that prevented the plugin from dropping multiple items of the same type.
    Version 1.3.2 (04/09/2011)
    • Fixed a bug that caused undefined blocks not to drop anything. (Reported by DjinnRutger)
    Version 1.3.1 (04/08/2011)
    • Fixed a bug that caused the iron hoe not to get damage when used to break blocks.
    • Fixed a bug that prevented the plugin from dropping multiple different items.
    • The config file structure has changed ! Make sure to update your file. This structure is temporary and will be replaced by a more tidy one in the next version.
    Version 1.3.0 (04/05/2011)
    • Added ability to make block drops a certain item regardless of the tool used. (Idea by Andrew0085)
    • Added ability to restrict drops to more than one group. (Requested by Andrew0085 and SpyDaniel)
      • Replaced "group" by "groups" in the configuration, do not forget to update your file !
    Version 1.2.1 (04/03/2011)
    • Fixed a bug that caused hoes to be unbreakable. (Reported by Leemur)
    Version 1.2.0 (04/03/2011)
    • Added ability to restrict drops to certain groups. Uses the Permissions plugin.
    Version 1.1.0 (04/02/2011)
    • Added ability to select what item is dropped when a block is destroyed by fire.
    • Added support for dyes/wool color.
    Version 1.0.1 (04/02/2011)
    • Renamed project to DropEdit.
    Version 1.0.0 (04/01/2011)
    • First build.
    _______________________________
    [​IMG] - Thanks a lot for your support !
     
  2. Offline

    NuxlyStardust

    New version available. I fixed that WorldGuard problem and made some changes to the code to avoid issues with other plugins. Residence should now be working fine too.
     
  3. Offline

    shadyre

    Hi, i report a bug ... i can't used the same item as 3 options :

    Code:
    items:
        NetherrackHand:
            id: 87
    
        NetherrackIronHovel:
            id: 87
            min: 1
            max: 2
    
        NetherrackIronPick:
            id: 87
            min: 1
            max: 5
    
    break:
        # Break netherrack with iron pick
        '87':
            '257':
                - NetherrackIronPick
    
        # Break netherrack with iron hovel
        '87':
            '256':
                - NetherrackIronHovel
    
        # Break netherrack with your hand
        '87':
            '0':
                - NetherrackHand
     
  4. Offline

    NuxlyStardust


    You shouldn't repeat "87:" everytime:

    Code:
    items:
        NetherrackHand:
            id: 87
    
        NetherrackIronHovel:
            id: 87
            min: 1
            max: 2
    
        NetherrackIronPick:
            id: 87
            min: 1
            max: 5
    
    
    break:
        # Break netherrack with iron pick
        '87':
            '257':
                - NetherrackIronPick
    
        # Break netherrack with iron hovel
            '256':
                - NetherrackIronHovel
    
        # Break netherrack with your hand
            '0':
                - NetherrackHand
     
  5. Offline

    shadyre

    Yes and i want ... if i brok a netherrack with hand i want drop only 1 blok, but if it's break with shovel i want 1 or 2, and with iron pick 1 or 5 ... multiple condition for the same block

    oh ... thank you it's worl -_-' sorry

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

    nemafow

    Hi Nuxly,
    What about if I wanted a block of stone to drop when using a wooden pickaxe on Stone, but if using any other item, it would drop air (as in nothing)? Can that be done?

    It may be easier if I show you exactly what I have, this is a small portion, essentially I want only Spades (each type) to drop dirt, any other item/tool used on dirt will drop air (nothing) ?
    items:
    Air:
    id: 00
    Dirt:
    id: 03
    # Dirt + Shovel -> Dirt
    '3':
    '269':
    - Dirt
    '273':
    - Dirt
    '256':
    - Dirt
    '284':
    - Dirt
    '277':
    - Dirt
    I tried adding on:
    '*':
    - Air
    But every tool I used (including spades) dropped air.

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

    NuxlyStardust

    You should fix the alignment, it won't work otherwise.

    And I think you'd have better luck if you put the '*' part first in the list. And keep in mind that this setup will only work when digging dirt, not grass.
     
  8. Offline

    nemafow

    Its all formatted properly in the config, just copy paste into the forums stuffs it all up. I originally put the '*' at the end, I will try at the start thanks

    Unfortunately that doesnt work :(

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

    NuxlyStardust

    Can you tell me more about what actually happens when you destroy the block?
    Does a dirt block drop even when you're not using a spade, or does nothing drop whatever you do?
     
  10. Offline

    cholo71796

    An interesting thing to add would be an optional else category- if it doesn't occur that the first thing stated drops, then this will drop- or then there is a chance that this will drop.

    Here is an example of what I mean:
    Code:
    items:
        stoneOccasionallyDropsGlowstone:
            id: 4
            groups:
                - GlowMiners
            chance: 98
            else:
                id: 89
                chance: 2
    
    break:
        '1':
            '*':
                - stoneOccasionallyDropsGlowstone
    which could also be written as
    Code:
    items:
        stoneOccasionallyDropsGlowstone:
            id: 89
            groups:
                - GlowMiners
            chance: 2
            else:
                id: 4
                chance: 98
    
    break:
        '1':
            '*':
                - stoneOccasionallyDropsGlowstone
    You would actually probably set this so it works only for a certain group of pickaxes, but that's not what I'm addressing here. The idea is that you have a group called GlowMiners and they get glowstone about 2% of the time they mine stone. It would be logical to think that you could just make two item entries, one with glowstone at 2% and one with stone at 98%, but it wouldn't work. You would get both glowstone AND stone 1.96% of the time when you want the drops to be disjoint events, and you would also get nothing 1.96% of the time.

    This sort of setup would make the two drops mutually exclusive, meaning that you would never get glowstone if you got stone and vice versa.

    You would not want to use a given probability system (where you would write "chance: 100" in the "else:" section) because it would quickly get confusing once you go past a single "else:" field. You would need to start drawing up tree diagrams and such.

    This is important (and useful) here:
    Code:
    items:
        LotteryBlock:
            id: 4
            groups:
                - *
            chance: 99
            else:
                id: 41
                chance: 0.25
                else:
                   id: 42
                   chance: 0.25
                   else:
                      id: 57
                      chance: 0.25
                      else:
                         id: 22
    
    break:
        '1':
            '*':
                - LotteryBlock
    Here we have a seemingly normal stone block that drops cobblestone 99% of the time. However, when it doesn't drop cobblestone, it will drop gold, diamond, iron and lapis blocks with equal likelihoods.

    If the "chance:" field was missing in the last else field (and it would only be allowed in the last else field) (like it is here), it would default to 100 - the sum of all parent "chance:"s. So here we would have (100 - (99 + 0.25 + 0.25 + 0.25)) which is 0.25.

    In the event that the last "else:" field's probability was specified and the sum of all probabilities was not 100, perhaps an error would write to console and that item would be ignored.

    I would like to use it on my server like this:
    Code:
    items:
        KnightStone:
            id: 4
            groups:
                - Knight
            chance: 50
            else:
                id: 1
    
    break:
        '1':
            '*':
                - KnightStone
    My Knight faction would get cobblestone and stone with equal probabilities while mining stone. Here the probability of it dropping stone would default to 50%.

    Also, thanks for adding damage value support!
     
  11. Offline

    NuxlyStardust

    I'm aware about that issue with the probability system. I'm planing to address this but I can't tell exactly when it will be done.
     
  12. Offline

    nemafow

    Hi Nuxly, when I put '*' at the start or the end, no matter what item I use, it destroys the block and nothing drops, spade or fist etc. If I remove the line it works as intended for those tools, but doesnt block out all other tools (which is what I want to happen).
     
  13. Offline

    dragonhib

    Hi !
    I love your plugin. But I think one thing is missing : possibility to change what mobs drop... Did you plan to add this ?
     
  14. Offline

    NuxlyStardust

    Nop sorry. My plugin's focus is really blocks. I'm pretty sure I saw a plugin that does it, I don't remember the name though. It had pretty much the same features as mine, with a min and max and a percentage of chance.
     
  15. Offline

    dragonhib

    Ok thanks for fast reply. I will look for a complementary plugin :)
     
  16. Offline

    nemafow

    Hi Nuxly, any idea what to do with my goal? Will I need to wait for an update?
     
  17. Offline

    NuxlyStardust

    Oh I'm sorry, I missed your previous post. I'll look at this issue today if I have some time :)
     
  18. Offline

    nemafow

    No worries thank you :)
     
  19. I'm trying to get stairs to drop stairs (Wood and Stone)

    Code:
    items:
         WoodS:
            id: 53
         StoneS:
            id: 67
    
    break:
        '53':
            '*':
                - WoodS
    
    break:
        '67':
            '*':
                - StoneS
    
    The wooden stairs isn't working?

    Also just in case, does the .jar go into /Plugins or /Plugins/DropEdit
     
  20. Offline

    NuxlyStardust

    The JAR goes in /plugins , the config.yml file goes in /plugins/DropEdit .

    About your config problem, try this:

    Code:
    items:
         WoodS:
            id: 53
         StoneS:
            id: 67
    
    break:
        '53':
            '*':
                - WoodS
        '67':
            '*':
                - StoneS
    
    No need to say "break:" twice, if you do the parser only sees the last one. That's why the wooden stairs were not working.

    Let me know if you need more help :)
     
  21. Doh!

    I was reading your reply as what I put. I'll try that now :)
     
  22. Offline

    nemafow

    Hey Nuxly, sorry to keep hassling you, have you had any thoughts on my problem :) ?
     
  23. Offline

    NuxlyStardust

    I'm really sorry but I can't work on it right now cause I'll be on exams soon and I have a different project eating up my free time. I'll work on it when I can but I can't guarantee when.
     
  24. Offline

    nemafow

  25. Offline

    Owel

    First, very nice job. Thanks for this plugin.

    But, is it normally Dropedit could not load if he has more than 104 lines in his config ?

    In server console, message "Dropedit could not load line 106" appear. So when I delete some lines to 104 lines, at this time, Dropedit load (I use Notepad, I'm sure that my config is right (for align) with Indentation Help).

    Sorry for my bad english and thank you in advance.
     
  26. Offline

    NuxlyStardust

    Thanks for your comment.

    I believe someone here successfully loaded DropEdit with more than a thousand lines, so the size of the file is clearly not an issue.

    In any case, my plugin doesn't issue that message. It must be from the YAML parser, so you must have an error somewhere near the end of the file. I'll be able to help you more if you post the full error message, and the config file on CodePaste.
     
  27. Offline

    m5k

    First, I'd like to thank you for this incredible plugin. The amount of customization it allows you is mind blowing. This is the core plugin of our RPG server now. I'm trying going to add very rare drops to each class now but I have a suggestion before I do so. Add the possibility to print the person who gets the drop a message. Example: A lumberjack class destroys a wood block, he gets 1 wood, 1 iron axe. A message is printed:
    You have found someones old iron axe stuck in the trunk.

    Code:
    items:
        Wood:
            id: 17
            chance: 100
            groups:
                - Lumberjack
    
        IronAxeDrop:
            id: 258
            chance: 2
            message: 'You have found someones old iron axe stuck in the tree trunk'
            groups:
                - Lumberjack
    
    break:
        '17':
            '*':
                - IronAxeDrop
                - Wood
    This has endless possibilities.
     
  28. Offline

    NuxlyStardust

    Thanks for your comment.
    This is a very nice idea, I might work on it today as it is fast to implement. I'll work on all of you guy's suggestions if I have the time.

    Stay tuned :)
     
  29. Offline

    m5k

    I greatly appreciate this. My server is about to pass the beta stage, mostly thanks to your plugin.
     
  30. Offline

    NuxlyStardust

    Good :)

    I'm just done uploading the new version, you can download it from the main post (1.4.4).
    I did as you suggested so your syntax will work.

    Let me know if you need anything else :)
     
  31. Offline

    peaced

    hi there, using 1.4.4 on CB798.
    I set up leaves to drop leaves and other stuff. The weird thing is if I destroy leaves rapidly, only the 1st one drops, all the other leaves after that dorp nothing.
    Until I change tree and it happen again.

    here is my conf :
    Code:
    items:
        Leaves:
            id: 18
            durability: 0
    
        Leavesone:
            id: 18
            durability: 1
    
        Leavestwo:
            id: 18
            durability: 2
    
        Ice:
            id: 79
    
        RedApple:
            id: 260
            chance: 5
    
        CocoaBeans:
            id: 351
            durability: 3
            chance: 1
    
    break:
        '79':
            '*':
                - Ice
    
        '18,0':
            '*':
                - Leaves
                - RedApple
                - CocoaBeans
    
        '18,1':
            '*':
                - Leavesone
                - RedApple
                - CocoaBeans
    
        '18,2':
            '*':
                - Leavestwo
                - RedApple
                - CocoaBeans
     

Share This Page