[MECH/FUN] BinaryBlood v0.5.1 - Make players/NPCs bleed using DoT! [670-1000]

Discussion in 'Inactive/Unsupported Plugins' started by Binaryclock, Apr 8, 2011.

  1. Offline

    Binaryclock

    BinaryBlood - Implements bleeding via a timed task at regular intervals. RPG players will recognize this as a DoT effect. This is a small section of the larger plugin called 'ClockMod.'

    Version: v0.5.1 - Compiled against RB 1000 (works and tested with 670 to 1000)

    BinaryBlood makes players and NPCs experience the joys of bleeding and incurring damage over time. Ever wanted to make that gold sword actually worth using in battle? Well your dreams have come true. One hit with that gold sword and you can do some great damage over time with the bleeding code.

    Downloads:

    Detailed Description

    The plugin is heavily configurable. You can configure which items cause bleeding, the chance of the bleeding code executing when hit, the amount of damage each tick inflicts on the target, the amount of ticks a certain item makes a player bleed for, the messages displayed when a player is bleeding, the duration of delay between each tick, and much, much more!

    You can also make players bleed from breaking glass with their own bare hands! Make them pay for their stupidity!

    As an added Easter-egg, when a player is bleeding he/she can punch white wool and make it red (bleeding on the wool.) This feature like all other features can be disabled/enabled.

    Here is how you would add an item in to the configuration:

    Code:
    # gold sword (283) - at least they aren't useless now!
    item_283_dmg_per_tick=1
    item_283_total_ticks=5
    item_283_chance_of_bleed_when_hit=80
    

    In the above example, item 283 is a gold sword. If you wanted to add a different item instead, just change the number after Item_ to any item in the data values wiki available here: http://www.minecraftwiki.net/wiki/Data_values


    Features:

    All features can be enabled/disabled using the configuration file as I believe strongly in user configuration and customization.
    • Make players and NPCs bleed using any wield-able item in the database.
    • Highly configurable - can change every setting, display message, even the timing!
    • Punish players for breaking glass with their bare hands.
    • Bleed on white wool to make it turn red.
    • Permissions support
    • Developer support - use BinaryBlood to make players bleed from your own plugin! See below for details.

    Permissions Support:

    There is only one setting in Permissions:
    • 'binaryblood.nodamage' - If this permission is assigned, the player/group will not take damage when bleeding.

    WorldGuard Support:

    This plugin will detect PVP safe zones that have been set by the WorldGuard plugin. If an attacker attempts to initiate a bleed inside a PVP protected zone no bleeding will occur. However bleeding will still occur on a player who is hit outside of the PVP zone then runs back in to the PVP protection.​

    Please use these versions of WorldGuard/WorldEdit if you would like BinaryBlood to protect players from bleeding in PVP free zones:
    • WorldEdit 4.3
    • WorldGuard 5.0 alpha 8

    For Developers - Hook in to the bleeding code!

    Want to make your plugin make players bleed? Don't reinvent the wheel - hook in to the DoT bleeding code of BinaryBlood. Here's how:

    Details for Developers! (open)

    There are two main public functions that you can use from your package. Both of these functions are in the BinaryBloodPlugin class.
    • public void setBleeding( Player player, int ticksToBleed, int bleedingDamagePerTick )
      Allows you to add a player to the bleeding task. I think it's pretty self-explanatory with the variable names.​
    • public void setBleeding( LivingEntity le, int ticksToBleed, int bleedingDamagePerTick )
      Allows you to add an NPC to the bleeding task.​

    • public final HashMap<String,EntityBleeding> getBleedingList()
    Returns an unmodifiable list of players or NPCs that are currently bleeding. This is in a HashMap format with the player's name as the key. The EntityBleeding object is a public object that can be imported using:
    Code:
    import com.binaryblood.EntityBleeding
    
    In order to find out if the EntityBleeding object is a player or an NPC, you can check it and cast it using the the following code:
    Code:
    EntityBleeding eb;
    if ( eb instanceof PlayerBleeding )
    {
       PlayerBleeding pb = (PlayerBleeding)eb;
       String name = pb.getName(); // player name
       // maybe some find player function to find the player object in one of the worlds..
    }
    else if ( eb instanceof NPCBleeding )
    {
       NPCBleeding nb = (NPCBleeding)nb;
       int id = nb.getUniqueId();
       String world = nb.getWorld();
       // maybe some function to find the NPC in the world called 'world' comparing the id.
       ...
    }
    
    PlayerBleeding uses a "String name" member to identify the Player.
    NPCBleeding uses both the unique id of the NPC, and the world that the NPC resides in to check to see if you have identified the correct NPC.


    1. Add these imports, members, and functions to your main class that extends JavaPlugin. Usually this is contained in something like MyPlugin.java file.

    Imports:
    Code:
    import com.binaryblood.BinaryBloodPlugin;
    import com.binaryblood.PlayerBleeding;
    import org.bukkit.plugin.Plugin;
    
    Members:
    Code:
    public static BinaryBloodPlugin BinaryBlood;
    
    Function:
    Code:
    private void setupBinaryBlood()
    {
        Plugin test = this.getServer().getPluginManager().getPlugin( "BinaryBlood" );
    
        if ( YourPlugin.BinaryBlood == null ) {
            if ( test != null )
            {
                YourPlugin.BinaryBlood = ( (BinaryBloodPlugin)test );
                log( "BinaryBlood plugin detected! Will implement bleeding code!" );
            }
            else
                log( "BinaryBlood plugin not detected. Not using BinaryBlood." );
        }
    }
    

    2. Where ever you wish to start a player bleeding, just call something like this:

    Code:
    // check for BinaryBlood plugin.. if exists, let's make 'em bleed!
    if ( YourPlugin.BinaryBlood != null )
    {
           player.sendMessage( "You did something really stupid.." );
    
           // sets player to bleed for five (5) ticks, damaging player one (1) damage per tick
           YourPlugin.BinaryBlood.setBleeding( player, 5, 1 );
    }
    

    ..and the plugin will take care of the rest!

    Changelog:

    Version 0.5.1
    • Compiled against 677
    • NPCs can now be damaged by bleeding code.
    • Improved destruct() code to properly unregister bleeding task and clear hashtables upon reload/stopping the server.
    • Rewrite/rename of classes to properly incorporate NPCs in the bleeding hashtables using inheritance. This means there are some minor changes to the developer API to interface with the bleeding code. Please see above developer section.
    Back Versions (open)

    Version 0.4.3
    • Compiled against RB 674
    Version 0.4.2
    • Developers can now hook in to the bleeding code and functions by using setBleeding( .. ). Details above.
    • Added "Loading BinaryBlood <version>" in console/logs when plugin loads.
    Version 0.4.1
    • WorldEdit and WorldGuard support for PVP areas. Will not cut players in PVP protected zones. However player will continue to bleed in PVP areas if the cut was started outside of the area.
    Version 0.3.1
    • First publicly available release.


    Troubleshooting and Support

    Any questions, comments, or bug reports please post in this thread and include:
    • Bukkit Version: <version>
    • BinaryBlood Plugin Version: <version>
    • BinaryBlood blood.config file, pasted to http://pastie.org

    Still Not Sold?

    If you would like to see this plugin in action, visit my minecraft server Thunderdome. The address is: thunderdome-mc.com


    Hope you enjoy it :)
     
    kahlilnc, Sir Savary and Finer1 like this.
  2. Offline

    Clancy Dawson

    Cool idea, you could make it that they drop red wool as they bleed (of course this wool wouldn't be useable). Similar to the WasteProduct plugin when you eat food, you drop dirt.
     
  3. Offline

    Binaryclock

    Clancy:

    Thank you for your reply and suggestion.

    I am already working on that feature which will come out shortly. I figured it'd be a great way to find someone that is bleeding when they are running.

    Keep the ideas coming in. I'll add lots of features - but at the same time give everyone the ability to enable/disable each feature. Configuration is the key here!

    Thanks!
     
  4. Offline

    Teknology

    Good suggestion Clancy!
    Dropped red wool is a good idea, but it's copying WasteProduct, like you said, and maybe to make it more realistic, bleeding players could release smoke (this is just my opinion). This will be an indeed fun plguin to use in wars and PvP-based servers. You got my support!
     
  5. Offline

    Binaryclock

    v0.4.1 is released now. Current changes include WorldGuard support so that bleeding cannot occur in WorldGuard PVP protected zones/areas. Make sure to use the recommended builds of WorldEdit and WorldGuard listed above in the first post in this thread. Please not that previous versions of WorldEdit/WorldGuard may be usable, but versions besides the recommended versions have not been tested.

    Enjoy :)

    0.4.2 - Added functionality for developers to access and utilize the internal DoT tasks to make players bleed from their own plugins.

    I'm waiting to see creative you guys can get with this :) If your plugin uses it, please let me know about it!

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

    Binaryclock

    Updated and compiled against the new Recommended Build 674
     
  7. Offline

    JuiceBox

    It would be great if you could choose to allow animals/monsters to experience the bleed effects as well.
     
  8. Offline

    Binaryclock

    Sounds good. Your wish is my command. I'll get this done shortly and it will be in the next version release.

    0.5.1 is released:
    • Compiled against 677
    • NPCs can now be damaged by bleeding code.
    • Improved destruct() code to properly unregister bleeding task and clear hashtables upon reload/stopping the server.
    • Rewrite/rename of classes to properly incorporate NPCs in the bleeding hashtables using inheritance. This means there are some minor changes to the developer API to interface with the bleeding code. Please see above developer section.

      Let me know if you find any issues with the new NPC bleeding code.

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

    steve m

    ccess, it also opens up the ability for hackers to connect with any username the
    y choose.
    03:03:14 [WARNING] To change this, set "online-mode" to "true" in the server.set
    tings file.
    03:03:14 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-653-
    g9992fff-b677jnks (MC: 1.4)
    03:03:14 [INFO] Preparing level "world"
    03:03:14 [INFO] Preparing start region
    03:03:14 [INFO] 144 recipes
    03:03:15 [INFO] BB [o] Opening blood.config file...
    03:03:15 [INFO] BB [o] Loading BinaryBlood v0.5.1
    03:03:15 [INFO] BB [o] Registering bleeding damage hook to itemId: 283
    03:03:15 [INFO] BB [o] Registering bleeding damage hook to itemId: 339
    03:03:15 [INFO] BB [o] Registering bleeding damage hook to itemId: 268
    03:03:15 [INFO] BB [o] Registering bleeding damage hook to itemId: fired arrows
    03:03:15 [INFO] BB [o] Registering bleeding damage hook to itemId: 276
    03:03:15 [INFO] BB [o] Registering bleeding damage hook to itemId: 267
    03:03:15 [SEVERE] ebean.properties not found


    does that have something to do with your plugin??
     
  10. Offline

    Binaryclock

    Steve:

    Thank you so much for your message.

    No, that would not be caused by the BinaryBlood plugin. BinaryBlood does not use ebeans nor does it modify the eben.properties file. To be sure, remove the plugin from your plugin folder and try running CraftBukkit again.
     
  11. Offline

    msw1

    Can you make the permissions the other way around? I am admin with '*' permissions, but I want to be able to take DoT. Help please?
     
  12. Offline

    Binaryclock

    Sure can. I'm just going out to the movies with my wife and son, but when I come back tonight I'll make a permission for you that will do this.
     
  13. Offline

    msw1

    Erm, been a few days with no edits or replies.
     
  14. Offline

    The PC Tech Guy

    Seems like he is, or was viewing this the moment you posted...
     
  15. Offline

    Uremir

    Hey Binaryclock, I am a fellow developer and I am trying to get your plugin to work in my code. I see that you have two "setBleeding()" methods: one for LivingEntity and one for Player. But, I can't seem to access the LivingEntity one in my code. The setBleeding for a Player runs fine, but when I put a LivingEntity in it, it tells me a Player is required.

    Thanks in advance for your help! -Uremir
     
  16. Offline

    zoolder101

    The nobleed permission does NOT work, plz help
     
  17. Offline

    swedish2011

    what has this to?
     
  18. Offline

    Plague

    cb 678 - inactive
     
  19. Offline

    Tulips

    can u get this compatable with levelcraft :/ i attacked a guy for testing realising i wasnt high enough level but it still made him bleed, i tested with gold sword
     
  20. Offline

    kahlilnc

    Ah this was in the back? Why is that I loved binary blood. I wanna add this again. :p
     
  21. Offline

    clitcomander

    please add actual visual blood to this, without it its not done.
     
  22. Offline

    Binaryclock

    "Visual Blood"? AFAIK that's impossible unless something has changed in the engine in the past few months that I haven't noticed. I did see some guy make redstone look like blood, but I'm not fond of that method.
     
  23. Offline

    clitcomander

    http://www.youtube.com/watch?v=-eoCG3SgE_A
    can you make it do this???
    just make a lil less fall out and only bones when the mob dies, and make it so when creepers explode the wool isent blown out of the ground as a pick up. that or take out creepers all together.
     
  24. Offline

    kahlilnc

    This is completely different. And thats bleedingmobs the plugin. Well it does the same thing that does.
     
  25. Offline

    JizzWizard

    Is this going to be compatible with build 1060 ever?
     
  26. Offline

    Slyvr

    How do I know if it's working for NPCs? I'm using npcx and their healths aren't configureable and there's no plans to update it...so something like this would be a quick fix I think. I set all default permission users to not bleed, so would NPCs still bleed?
     
  27. Offline

    hidro636

    Hmmm, won't let me go to the download page. It says that "it could not be found". Tried it in IE, Firefox, and Chrome.
     
  28. Offline

    md_5

    Binaryclock this is now inactive, please update to latest rb and tag me if you wish to revive
     
  29. Offline

    The PC Tech Guy

    I think it works, the only thing I'm not sure is if it's supposed to display a message if you are bleeding because of another player (you are only notified of bleeding if you have broken glass with bare hands).
     
  30. Offline

    NullCity

    I this plugin does not work in Bukkit 1.1-R4, then I can port it. :p

    - MintDev Owner
     

Share This Page