[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)
        [email protected]:
          - drop: APPLE
            chance: 5%
        [email protected]:
          - drop: [email protected]
            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

    - Slimes splits can't be stopped (more slimes appearing after one dies)

    I'll look into tapping into the slimesplitevent for 2.9.

    - When an anvil damages an entity this error occurs: http://pastebin.com/raw.php?i=MyyMD9Zw

    I think I've already fixed that error in the latest build (try here: http://ifami.dyndns.org:8080/job/OtherDrops/15/ )

    - When ANY_DAMAGE is one of the tools and a player gets killed by damage via OtherDrops, this error occurs: http://pastebin.com/raw.php?i=z7Jbfwrp (Add a new damage type for OtherDrops inflicted damage?)

    That's a new one - will look into that.

    - Parameters like loc-offset and quantity have to be defined for each individual drop in a dropgroup and cannot be defined above.

    I've got some ideas that might fix this and all other conditions/actions for dropgroups (if it works).

    - When a block breaks because the supporting block is removed, it will drop the default drops.

    Yeah, will have to look into the blockphysics event - reminds me to test the drop: NOPHYSICS option (I think it's gone in version 2.0 and newer) that stopped sand from falling.

    SUGGESTIONS:
    Show Spoiler

    -Add POTION as a projectile or add DAMAGE_POTION_<data value> as a damage type. At the moment splash potions of harming can only be detected by DAMAGE_PROJECTILE or PROJECTILE, which aren't specific enough.

    I think you might be able to use PROJECTILE_POTION?

    -Add flags: ONLY so that if no other events are triggered, this event will trigger. For example:
    Code:
      PLAYER:
          - tool: ANY_CREATURE
            message.server: "%v was killed by a mob"
          - tool: DAMAGE_VOID
            message.server: "%v was killed by the void"
          - message.server: "%v was not killed by a mob or the void"
            flags: ONLY 
    Sounds like a good idea but I think it'll be pretty tricky to implement, will think about it - perhaps add into the issues as a feature request?

    -If you really want to go big with this you could add new sections to the configuration files such as 'othercrafts' (control what is made by furnaces, crafting tables, brewing stands etc.), 'othercommands' (make new commands where the command could be linked with any other configuration/drop) , or 'otheritems' (damages/resistances/unique properties of armor/weapons/anything). This plugin would be the ultimate all-in-one, do-it-yourself, fully customizable, "an absolute must" for any server.

    Yeah, I'm thinking about these things but more likely will create a couple of other plugins that might use a common library so that OtherDrops doesn't get too crowded with features (can scare people off and harder to maintain).

    -Allow an offset and delay to be specified after a replacementblock (such as -replacementblock: [email protected]/0/0!500). If this were implemented, a city could literally be built on the death of a zombie, or the right-click on a block. Therefore multiple replacement blocks should probably be allowed as well, via "[]".

    Good idea but I'd be worried about wiping out my house if I kill a zombie :D

    -Allow all items to be used as the "block type" and add a new action: USE (similar to RIGHT_CLICK except the player is holding the object while clicking and not looking at the object while clicking) to allow for easier/better/more options. The default action for items would be 'USE', but it would have to be defined for blocks. The reason I am suggestion this is because the two examples below would otherwise be more complicated without it, and placing fluids is otherwise currently impossible to completely stop because they can be placed a little farther than the block selection distance.
    Code:
      SNOWBALL:
          - action: USE
            drop: DENY
      LAVA_BUCKET:
          - action: USE
            drop: DENY
    
    Interesting idea, I'll have to think about how it fits into the current code structure.

    -Add these sounds to what can be used under effects: http://jd.bukkit.org/rb/apidocs/org/bukkit/Sound.html

    Yeah, discovered this recently, definitely including it :D

    Don't think you should have to do any of my suggestions. I have ideas running through my head constantly and I like to share them.

    Don't stop with the ideas - lots of great ideas here :D

    [/quote]
     
  3. Offline

    Cultist O

    A while ago I mentioned an error when I break an Ender Crystal, here is the full report

    This also raises a question, if I was to kill the enderdragon by destroying a crystal it was healing from, what would it attribute the kill to? I assume ANY_TOOL would catch it, but not PLAYER

    Show Spoiler

    2013-03-08 18:03:30 [SEVERE] Could not pass event EntityDamageByEntityEvent to OtherDrops v2.8-beta5.1
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
    at net.minecraft.server.v1_4_R1.Explosion.a(Explosion.java:167)
    at net.minecraft.server.v1_4_R1.World.createExplosion(World.java:1608)
    at net.minecraft.server.v1_4_R1.WorldServer.createExplosion(WorldServer.java:773)
    at net.minecraft.server.v1_4_R1.World.explode(World.java:1600)
    at net.minecraft.server.v1_4_R1.EntityEnderCrystal.damageEntity(EntityEnderCrystal.java:63)
    at net.minecraft.server.v1_4_R1.EntityArrow.j_(EntityArrow.java:226)
    at net.minecraft.server.v1_4_R1.World.entityJoinedWorld(World.java:1332)
    at net.minecraft.server.v1_4_R1.WorldServer.entityJoinedWorld(WorldServer.java:548)
    at net.minecraft.server.v1_4_R1.World.playerJoinedWorld(World.java:1313)
    at net.minecraft.server.v1_4_R1.World.tickEntities(World.java:1191)
    at net.minecraft.server.v1_4_R1.WorldServer.tickEntities(WorldServer.java:445)
    at net.minecraft.server.v1_4_R1.MinecraftServer.r(MinecraftServer.java:580)
    at net.minecraft.server.v1_4_R1.DedicatedServer.r(DedicatedServer.java:224)
    at net.minecraft.server.v1_4_R1.MinecraftServer.q(MinecraftServer.java:494)
    at net.minecraft.server.v1_4_R1.MinecraftServer.run(MinecraftServer.java:427)
    at net.minecraft.server.v1_4_R1.ThreadServerApplication.run(SourceFile:849)
    Caused by: java.lang.NullPointerException
    at com.gmail.zariust.otherdrops.event.OccurredEvent.<init>(OccurredEvent.java:161)
    at com.gmail.zariust.otherdrops.listener.OdEntityListener.onEntityDamage(OdEntityListener.java:59)
    at sun.reflect.GeneratedMethodAccessor88.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
    ... 19 more
     
  4. Offline

    Zarius

  5. Offline

    Cultist O

    ok, now I am getting:

    [INFO][OtherDrops:2.8b.156] EntityDamageEvent: tool is null, please inform developer.

    But it only seems to happen when I shoot it with an arrow. I've confirmed that it happens with or without enchantments and lore text

    Edit: It also happens with TNT explosions, but not my fist or a sword
     
  6. Offline

    ViperZeroOne

    I'm having some difficulties getting my events to occur. At present, none of them actually occur in-game and there are no errors appearing on the console.

    I don't believe this has anything to do with the scripting, as your tutorials are very well done, but if you could give it a look over anyway I would appreciate it.

    http://pastebin.com/J2feNdjj
     
  7. Offline

    Zarius

    Thanks, I'll look into this one.

    The config/scripting looks fine & I can see it included the file fine. None of them are working at all?

    Can you try setting the verbosity (at the top of otherdrops-config.yml) to HIGH? This should result in more messages at startup which might show what the issue is. (an important line will be one that shows "Register listeners: ...")
     
  8. Offline

    ViperZeroOne

    I changed the verbosity, as you suggested, and the only noticeable output was during the server startup. There isn't any output or errors while the server is actually in operation, and the events still don't occur in-game. I actually increased the chance of them happening to 100, just for testing. Here's the output from the startup;

    Code:
    2013-03-11 15:15:28 [INFO] [OtherDrops] Enabling OtherDrops v2.8b.156
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] [Event Explosions] Explosions v1.0 loaded.
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] [Event Sheep] Sheep v1.0 loaded.
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] [Event Trees] Trees v1.0 loaded.
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] [Event Weather] Weather v1.0 loaded.
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Events loaded: [EXPLOSION, SHEAR, UNSHEAR, SHEARTOGGLE, DYE, TREE, FORCETREE, LIGHTNING, STORM, THUNDERSTORM]
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Loaded global config (plugins\OtherDrops\otherdrops-config.yml), keys found: [verbosity, money-precision, customdropsforexplosions, default_dropspread, disable_xp_on_non_default, enchantments_ignore_level, enchantments_use_unsafe, allow_any_replacementblock, money_overrides_default, xp_overrides_default, loot_overrides_default] (verbosity=HIGH)
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Found plugin(s): 'LogBlock'
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Plugin(s) not found: 'WorldGuard, BigBrother, HawkEye, MobArena, MoneyDrop, RegenBlock, Heroes' (OtherDrops will continue to load)
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Loading file: otherdrops-drops.yml
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Loading file: includes/od-playerdeath_zombie.yml
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] BREAK ANY_OBJECT w/ {ANY=true} -> [email protected]
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Loading file: includes/vipercraft.yml
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Register listeners: EntityListener, VechicleListener.
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] Custom Metrics, logging: BREAK+1
    2013-03-11 15:15:28 [INFO] [OtherDrops:2.8b.156] OtherDrops loaded.
    
     
  9. Offline

    Zarius


    Ok, I can see that it's actually only loading the one config from the player zombie death. That previous pastebin is the whole contents of your vipercraft.yml file? If so you need to start the file with the line "otherdrops:" and indent each target line (CREATURE_HOSTILE:, NETHER_WARTS, etc) in by two spaces.
     
  10. Offline

    ViperZeroOne


    Adjusted, as you stated, and it looks like the vipercraft.yml file is being loaded. That said, the startup has basically blown up on me now.

    http://pastebin.com/nyqj9iPq

    I commented out the "Creeper" section and everything (but the creeper) seems to work without errors. That said, that creeper section came straight from your tutorial, so perhaps it's a bug?
     
  11. Offline

    Zarius

    No, it's just that the config file needs all the seconds indented properly. When I've got some time I'll check the previous config you posted and post you a new copy of that.
     
  12. Offline

    ViperZeroOne

    I did find the problem, there was an extra space on one of the lines. Thanks for the hint.
     
  13. Offline

    Enolamron

    I've been looking for the answer but I take it using blockbreakers and turtles is out of the question because they place the items right in a inventory, right? What about using ic2 mining lasers? I have had no luck with those either. I'm sure this is a repost and I am sorry for that, I just can't seem to find the answer or a example if it can be done using any of the above items/tools.

    Thanks
     
  14. Offline

    Zarius

    Yeah, anything that bypasses the blockbreakevent and gives the player the item directly will also bypass OtherDrops.
     
  15. Offline

    sicariusdracus

    I can't get anything other than magmacubes, ghasts, blazes, and pigzombies to spawn in my nether world. In my End world, only Endermen spawn. Here's my otherdrops:
    ANY_CREATURE:
    - action: MOBSPAWN
    world: Brimdawn # put whatever your world name is
    drop: {GHAST/10%, MAGMA_CUBE/10%, BLAZE/20%, [email protected]/10%, SKELETON/20%, PIG_ZOMBIE/15%, ANY_CREATURE/5%, WOLF/5%, PIG/5%}
    ANY_CREATURE:
    - action: MOBSPAWN
    world: Endlands # put whatever your world name is
    drop: {SPIDER/15%, MAGMA_CUBE/10%, ENDERMAN/30%, CAVE_SPIDER/10%, SILVERFISH/10%, SKELETON/15%, ANY_CREATURE/9%}
    CREATURE_ENDERMAN:
    - dropgroup: calloftheender
    world: Endlands
    chance: 1%
    drops:
    - drop: {ENDER_DRAGON/100%}
    message: "As you slay the Enderman, it calls to the Ender Dragon."
    CREATURE_WITHER:
    - dropgroup: callofthewither
    world: Brimdawn
    chance: 1%
    drops:
    - drop: {WITHER/100%}
    message: "As you slay the Wither Skeleton, it changes into its true form."
    CREATURE_ZOMBIE:
    - dropgroup: zombie_rainynight
    time: NIGHT
    weather: RAIN
    drops:
    - drop: SLIMEBALL # zombies are slimy on a rainy night?
    - drop: DIAMOND/1%
    message: "You see a diamond glinting in the darkness."
    - dropgroup: zombie_dayindesert
    time: DAY
    biome: DESERT
    chance: 50%
    drops:
    - height: ">64"
    drop: DEAD_BUSH
    - height: "<65"
    drop: EGG
    message: "Looks like the zombie found an egg."
     
  16. Offline

    Zarius

    Just noting for the record that sicariusdracus fixed the above issue (indentation was wrong somewhere).
     
  17. Offline

    Vorsath

    I'd like to force it so a zombie spawns wearing the killed player's equipment (ex: PlayerA is wearing a full suit of Iron Armour and holding a Stone Sword, PlayerB kills PlayerA, event triggers and spawns Zombie, Zombie is equipped the same as PlayerA, thus wearing full suit of Iron Armour and holding a Stone Sword.)
    I know they can pick up equipment, but I just want to make sure, as sometimes they don't care about equipment and just walk on by, so how would this be done, if possible?

    Also, is it possible to set Damage or Armour values for weapons/armour or other items where applicable, similar to setting a mobs health when spawning them? If not, I'd like to forward this as a suggestion :)
     
  18. Offline

    Zarius

    Vorsath

    Not currently but a possible feature for a future version - something like:

    Code:
      PLAYER:
        - drop: [email protected]:THIS
    
    Damage/armour values is trickier as there's no in-built variables for this on tools/armour. Probably better for another plugin and with on integrating it with OtherDrops.
     
  19. Offline

    Vorsath

    Code:
    PLAYER:
        - drop: [email protected]:THIS
    Yeah, that sounds good, possibly allow other mobs too, not just zombies? *crosses fingers and hopes for this :)

    There are definately other plugins which can set damage and armour values, like ChangeDamage: "http://dev.bukkit.org/server-mods/changedamage/" which allows you to set damage for any item (fun setting a melon stem to do 100 damage and instantly kill anything with it :D), and even armour values for armour, but was hoping on being able to set them for individual items, so you spawn in a sword with damage set to it and only it, so no other swords of its type are affected.
    But if it's too much work or whatever, no worries, OtherDrops is already able to do so much and thank you for your efforts to keep it up to date and funtional, was worried when there was no sign of you for those few months :)
     
  20. Offline

    Zarius

    Vorsath

    Already supports any standard Bukkit mob (current and future mobs) :D See the list of EntityTypes here.

    Just worried about OtherDrops being too overloaded - I might consider another plugin that depends on OtherDrops but is optional (got a lot of work on OtherDrops first though :))
     
  21. Offline

    Vorsath

    That would be cool, I can understand the need to keep the plugin simple for certain audiences and the like, so no biggie.

    Now, a possible bug I just noticed... I am trying to use ANY_CREATURE or EVERY_CREATURE, and when loading the server I get the following warning:
    "5:44:30 PM [WARNING] [OtherDrops:2.8b.299] Unrecognized target (skipping): EVERY_CREATURE"

    EDIT: Oh, CB version 1.5.1 R0.1 #2686
     
  22. Offline

    Zarius

    EVERY_CREATURE doesn't exist. You could possibly try ^ANY_CREATURE but be warned, that _ will_ drop 1 of every creature type. What are you trying to use it for?
     
  23. Offline

    Vorsath

    Code:
        ANY_CREATURE:
            - drop: [email protected]
              chance: 0.5%
    Simply to get all creatures to have a small chance of dropping a spawn egg on death, I tried ANY_CREATURE with the same result, only tried EVERY_CREATURE after looking it up in the documentation. From the creature page: "As a drop, creature group synonyms can be prefaced with a carat (^) to force OtherDrops to spawn every applicable creature rather than just picking one. (^ANY_CREATURE can also be written asEVERY_CREATURE.)"
     
  24. Offline

    Zarius

    Ah cool, was just thinking I should make every_ creature match ^ any_ creature, already done :)

    Yeah, ANY_CREATURE is the right thing there, note that the docs state every_creature is for drops.

    The code you posted should work fine, have you tried putting the change to 100 percent to test it?
     
  25. Offline

    Vorsath

    As I said, I used ANY_CREATURE first and after console sent that warning, I tried EVERY_CREATURE and it still did it... Now I tried setting chance 100% and console stopped giving the warning, then swapped back to 0.5% and it seems to be fine now.

    EDIT: Not completely fine however, for some reason when a Spawn Egg drops (so far regardless of creature), it is not coloured, named "Spawn", and does nothing when you try to use it.
     
  26. Offline

    Zarius

    Vorsath

    Careful with "edit" on posts - it doesn't alert me to a new post so only saw this now :)

    I don't think SPAWN_EGG will work unless you're using one of the latest dev releases of OtherDrops - I've only just added that as an alias. The official bukkit name is MONSTER_EGG, try that one.
     
  27. Offline

    sirdave79

    Hello.

    this is my first post on the bukkit forums. My friend and I have just made our forge server an MCPC+ server. It went surprisingly (to us) well. Now our server has 90 forge mods and 1 or 2 bukkit plugins. I was interested in MCPC+ for 2 reasons above others.

    1) Control over the drops of all entities. It seemed there was more than 1 plugin offering this and i couldnt find a single forge mod offering this.

    2) better performance of server, especially when riding mounts. This was poor previously on our forge server.

    I made the assumption that a bukkit plugin offering control of mob drops would "just work" for all mobs available to the current game. (I did not consider that perhaps most of the mob adding mods I use are forge mods and may not even be available on bukkit).

    Sadly having created our MCPC+ server it seems that your plugin will not control the drops for say, mo creatures ? (for which an actual bukkit plugin exists I believe). I am also running the forge mods, atmosmobs and project zulu which mostly add creatures/animals. I wanted to rationalise the drops across all 3 mods. Id also like to add 1 or 2 hostile mobs mods (forge again) I think from having read this thread, the suggestions and some of the documentation this is not currently possible ?

    I know nothing about bukkit right now, but if these mobs/mods are not currently supported I wonder if I could draw your attention to the following forge mod

    http://www.minecraftforum.net/topic...empts-mocreaturesextrabiomes-support-updated/

    That mod is a master spawn control for other mods mobs. I dont know how it does it but it basically obtains a list of all entities "installed", also all biomes "installed" (via extrabiiomes XL or Biomes of Plenty) and offers these mobs to be configured for a "per biome" spawn setup in a GUI(not necessary for me, config files fine).

    I wonder if its methods might make it easier for your mod to control drops on mod added mobs without explicit support ? I realise I know very little about bukkit so I apologise if what im saying is stupid or ignorant.

    I also apologise if this post is too long, thanks for reading and I hope that I will get control of these mobs drops some time in the future. (sooner rather than later, one way or another)
     
  28. Offline

    Vorsath

    Zarius

    Sorry about the EDIT, didn't want to double post :)

    Code:
        ANY_CREATURE:
            - drop: [email protected]
              chance: 100%
    This is having the same effect as using [email protected], tested by killing a zombie, chicken, sheep and a pig with both versions.

    [email protected], replacing CREATURE with the name of the mob on the individual like this:

    Code:
        ZOMBIE:
            - drop: [email protected]
    works fine however.

    OtherDrops version in use is: OtherDrops:2.8b.299
    CB version in use is: 1.5.1 R0.1 #2710
     
  29. Offline

    Zarius

    sirdave79

    Thanks for the detailed post and information on modded mobs. You are correct - whilst OtherDrops does support modded blocks - modded mobs are not yet supported.

    The reason for this is that modded mob support would rely on what you could call "unsafe" or "volatile" code linking into minecraft itself rather than the Bukkit API. The danger of linking this way is that, whilst the Bukkit API is stable, the minecraft classes/methods could potentially change and break things each time Minecraft updates. I have some ideas for working around this however and enabling modded mob support for CraftBukkit at least, not sure how this will work with BukkitForge. I'll look into this though, so keep an eye open - or even better, jump into the OtherDrops IRC channel sometime.

    Vorsath

    Thanks, I'll look into [email protected]
     
  30. Offline

    sirdave79

    Thanks very much for your response.

    From what ive been learning recently about minecraft spawning and mobs, the seeming real lack of a standardised set of properties for entities makes adding multiple mods adding mobs a real mess. Im not surprised this is a tricky thing to do in a sound fashion.

    Ill have to sort out IRC.

    Thanks for reading
     
  31. Offline

    notjerem

    Hi,

    Why :

    CREEPER:
    -drop: STONE


    For exemple, don't works ?
    I'm not abble to make the pluggin drop anything from creeper. But with another creature, it works. =/
    I don't understand.
     

Share This Page