[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

    OtherDrops doesn't deal with an onAttack event so we can't drop items on wolf attacks.
     
  3. Offline

    Celtic Minstrel

    Would WOLF@ANGRY work? That is, define a drop for wolves that only applies to angry wolves.

    (Pretty sure this already exists, too.)
     
  4. Offline

    Zarius

    Ah, yes - that would work fine if notjerem was talking about killing angry wolves. I thought he was talking about dropping an item when the wolf attacks him :/
     
  5. Offline

    notjerem

    Zarius : you had understood. Sad, but thank you. Good plugin ;)
     
  6. Offline

    Celtic Minstrel

    If a wolf is attacking him, it's probably angry. Still, a tame wolf belonging to someone else also might attack him, so angry wolves doesn't catch all cases.
     
  7. Offline

    Zarius

    Yes, probably angry but OtherDrops will only trigger when you kill the wolf, not when the wolf attacks you.

    notjerem

    Glad you like it :)
     
  8. Offline

    Celtic Minstrel

    ...I thought he wanted something like "wolves only drop items when killed in self-defense", ie if it's attacking you it drops items when killed.
     
  9. Offline

    gawelium

    Hi, i'm back lol

    Does it correct ?

    Code:
        BREWING_STAND_BLOCK:
            - tool: ALL
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              drop: AIR
            - replacementblock: AIR
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
        ENCHANTMENT_TABLE:
            - tool: ALL
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              drop: AIR
            - replacementblock: AIR
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
        CAULDRON_BLOCK:
            - tool: ALL
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              drop: AIR
            - replacementblock: AIR
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
    Because it doesn't work correctly.
    Thank's
     
  10. Offline

    Celtic Minstrel

    I'm not sure what aliases he has defined, but maybe try leaving off the "_BLOCK" part?
     
  11. Offline

    gawelium

    Yes thanks, but I can use the items.
    LEFT & RIGHT CLICK are correct ?
     
  12. Offline

    Celtic Minstrel

    Yeah, they should be correct.
     
  13. Offline

    Zarius

    Actually - Celtic Minstrel's right. I haven't defined a CAULDRON_BLOCK or BREWING_STAND_BLOCK alias - you should be getting errors when OtherDrops starts up.

    The Bukkit defined names are CAULDRON & BREWING_STAND (see here for the full official list of Bukkit materials). I do note that the OtherDrops BukkitDev page hasn't been updated and states _BLOCK as a "planned" name - I'll update that page and add _BLOCK for both of these as an alias.

    In regards to the config itself I'm not 100% clear as to what you're trying to do. At the moment you're making them drop AIR (nothing) for anyone and then separately sending a message to anyone with the "serf" permission (the replacementblock: AIR is not needed as it doesn't do anything).

    I think what you're trying to do is disallow the drop for players with the "serf" permission? You just need to remove the second dash (as it's separating the config into two blocks so that the permission condition only applies to the second block), eg:
    Code:
     BREWING_STAND_BLOCK:
            - tool: ALL
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              drop: AIR
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
    
    So anyone with the "otherdrops.custom.serf" permission will get the message and no drop. Other players will get the normal default drop and no message.

    gawelium

    Oh, it just occurred to me that you might be wanting to do two separate things: stop cauldron/brewingstand/enchantment tables from dropping (ever) and on a right/left click by someone with the "otherdrops.custom.serf" permission make the block disappear.

    In this case "left/right click" doesn't make a different for the first block (dropping air), only need break. For the second block (block disappears for serf's on left/rightclick) you need to make sure it has the correct "action" line, eg:

    Code:
     BREWING_STAND_BLOCK:
            - tool: ALL
              action: [BREAK]
              drop: AIR
    
            - replacementblock: AIR
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 15, 2016
  14. Offline

    gawelium

    :D You're the best man, I'm sure, Congratulations, Thank you :D

    But we have to remove "_BLOCK" because in the console it's written : "Unrecognized target (skipping): BREWING_STAND_BLOCK" and "Unrecognized target (skipping): CAULDRON_BLOCK". So I removed "_BLOCK" and it works very very well.

    Again : thank you !!

    It's me again !
    Little problem : so with "serf" group the permission works but also with "admin" group (permissions : '*')
    What's the problem ?

    New code :
    Code:
    otherdrops:
        BREWING_STAND:
            - replacementblock: AIR
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
        ENCHANTMENT_TABLE:
            - replacementblock: AIR
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
        CAULDRON:
            - replacementblock: AIR
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
        IRON_ORE:
            - tool: ANY_PICKAXE
              drop: AIR
            - replacementblock: IRON_ORE
              permissions: serf
    
    The group "admin" has permission '*' and the group "serf" has : otherdrops.custom.serf
    But restriction works with "admin" too :(

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

    Zarius

    gawelium

    Yes, that's a problem with giving admins '*' permissions - they get every permission including the 'otherdrops.custom.serf' one. One way around that is to use "permissionsexcept: aboveserf" and give that permission to the next rank up.
     
  16. Offline

    gawelium

    Sorry I don't understand your last sentence (yes i'm french lol)
    I put "permissionsexcept: aboveserf" under "permissions: serf" (in file .yml in otherdrops) ?

    Code:
    otherdrops:
        BREWING_STAND:
            - replacementblock: AIR
              action: [BREAK, LEFT_CLICK, RIGHT_CLICK]
              message: Tu n'as pas le grade pour cet objet.
              permissions: serf
              permissionsexcept: [mineur, bucheron, admin]
     
  17. Offline

    Zarius

    That should work (if you only have three other groups), but get rid of the "permissions: serf" line.
     
  18. Offline

    gawelium

    Yes the names of the groups were an example :) just to see if it's work.
    So now with permissionsexcept, that's work ! but "permissions: serf" line must be write.

    You made a great job ! thanks
     
  19. Offline

    dragonking

    thanks for the reply, i will try it out as soon as i can, looks like a good alternative to dropbonus :)
     
  20. Offline

    tharbakim

    I played around for a bit, and I couldn't come up with a way to stop falling blocks (sand, gravel) which fall onto an object (torch, sign, etc.) To stop dropping blocks.

    Couple members found a duplicating exploit with pistons, any idea on how I can clean it up?
     
  21. Offline

    Zarius

    tharbakim

    OtherDrops doesn't tap into the falling block event as yet - I'll keep it in mind for future development.
     
  22. Zarius

    Using OtherDrops v2.5 and CB 2082.

    Code:
    2012-03-16 13:25:36 [SEVERE] Could not pass event VehicleDestroyEvent 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 net.minecraft.server.EntityMinecart.damageEntity(EntityMinecart.java:155)
            at net.minecraft.server.EntityHuman.attack(EntityHuman.java:749)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:1083)
            at net.minecraft.server.Packet7UseEntity.handle(SourceFile:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:116)
            at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
            at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.NullPointerException
            at com.gmail.zariust.otherdrops.event.OccurredEvent.<init>(OccurredEvent.java:190)
            at com.gmail.zariust.otherdrops.listener.OdVehicleListener.onVehicleDestroy(OdVehicleListener.java:43)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
            at java.lang.reflect.Method.invoke(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
            ... 12 more
    
     
  23. Offline

    gawelium

    It's with WorldGuard. In onfig.yml, there is the physics properties : sand/gravel
    Code:
    physics:
        no-physics-sand: false
        no-physics-gravel: false
     
  24. Offline

    Celtic Minstrel

    If Zarius feels like implementing something for that, there's a new BlockFallEvent pending which satisfies that need.
     
  25. Offline

    Zarius

    Found the problem and fixed it - new build soon.

    Thanks - I'll keep that event in mind.
     
  26. Thanks! Another problem i have is that i use a plugin to disable enviromental damage from creeper explosions. I also spawn super creepers from creeper killing creeper and theese super creepers explode on death. Problem is that the final 'explosion' is not a creeper explosion so it makes a crater. Would it be possible to have creeper explosion as a choise aswell?
     
  27. Offline

    Zarius

    Sorken

    Can you post an example of the relevant parts? Is it like "creeper@powered: - event: explosion"? And what config do you use to deny the environmental damage?
     
  28. Code:
      [EMAIL]CREATURE_CREEPER@UNPOWERED[/EMAIL]:
          - drop: NOTHING
          - tool: ANY
            drop: SULPHUR
            quantity: 1-2
            chance: 20
          - tool: [WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD]
            drop: [EMAIL]MONSTER_EGG@THIS[/EMAIL]
            quantity: 1
            chance: 0.1
            message: The soul crystalize into an egg that would fit nicely in a spawner!
          - tool: GOLD_SWORD
            drop: [EMAIL]MONSTER_EGG@THIS[/EMAIL]
            quantity: 1
            chance: 0.3
            message: The soul crystalize into an egg that would fit nicely in a spawner!
          - tool: CREATURE_CREEPER
            drop: [EMAIL]CREATURE_CREEPER@POWERED[/EMAIL]
            quantity: 1
            chance: 50
      [EMAIL]CREATURE_CREEPER@POWERED[/EMAIL]:
          - drop: NOTHING
          - toolexcept: [DAMAGE_FIRE, DAMAGE_FALL, DAMAGE_SUFFOCATION, DAMAGE_DROWNING, DAMAGE_CONTACT, DAMAGE_ENTITY_EXPLOSION]
            drop: SULPHUR
            quantity: 10
            chance: 100
            event: EXPLOSION
            message: As it dies, the supercreeper explodes a final time!
          - tool: [WOOD_SWORD, STONE_SWORD, IRON_SWORD, DIAMOND_SWORD]
            drop: [EMAIL]MONSTER_EGG@THIS[/EMAIL]
            quantity: 1
            chance: 1
            message: The soul crystalize into an egg that would fit nicely in a spawner!
          - tool: GOLD_SWORD
            drop: [EMAIL]MONSTER_EGG@THIS[/EMAIL]
            quantity: 1
            chance: 3
            message: The soul crystalize into an egg that would fit nicely in a spawner!
    
    Code:
    public class NoExplodeListener implements Listener {
        @EventHandler
        public void onEntityExplode (EntityExplodeEvent event) {
            if (event.getEntity() instanceof Creeper)
                event.blockList().clear();
        }
    }
    
    I tried adding instanceof Explosion aswell but it didnt seem to matter so i didnt test further to see if also impacted tnt, ghasts and such.
     
  29. Offline

    Zarius

    Sorken

    Try checking if the explosion event has an originating entity, eg.

    Code:
    if (event.getEntity() == null) {
      // it's a custom explosion from somewhere, let's assume OtherDrops and clear blocks
    }
    
    Shouldn't have any impact on ghast/tnt/etc explosions - only a problem if you have other plugins that create explosions manually.

    Everyone

    Version 2.6 will have a large change - I'm making the default action that money & xp will no longer override the default drop. That seems to be more intuitive to me.

    So, a drop that defines just money or XP will still drop the default "loot". XP drops will still override the default XP drop (and you can use this to cancel the XP completely if you want, just drop: XP/0).

    This will be configurable (per file or globally) if you have need to change it.

    Let me know what you think.

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

    Celtic Minstrel

    ...there's seriously a member called "Everyone"?
     
  31. Zarius
    I dont have any other plugins that create explosions, ill give it a whirl.

    About the drops it seems logical since other drops work the same way, unless you specify a drop: NOTHING. Also, i think most people have no idea how much exp each creature drops so having the default as a base seems good.
     

Share This Page