AttributeDemo 1.0

Demo plugin to show simple usage of Attribute API.

  1. md_5
    Tested Minecraft Versions:
    • 1.9
    *** 1.9+ ONLY ***

    This is a demo plugin to show the new Attribute API in 1.9. By default it will simply change the attack speed to 4x its value (4 -> 16) to implement 1.8-esque attacking. You may simply add additional attributes to config.yml to modify them too.

    Code (YAML):
    GENERIC_ATTACK_SPEED: 16
    Source Code:
    Code (Java):
    package net.md_5;

    import org.bukkit.attribute.Attribute;
    import org.bukkit.attribute.AttributeInstance;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.plugin.java.JavaPlugin;

    public class AttributeDemo extends JavaPlugin implements Listener
    {

        @Override
        public void onEnable()
        {
            getConfig().addDefault( Attribute.GENERIC_ATTACK_SPEED.name(), 16 );
            getConfig().options().copyDefaults( true );
            saveConfig();

            getServer().getPluginManager().registerEvents( this, this );
        }

        @EventHandler
        public void playerJoin(PlayerJoinEvent event)
        {
            for ( String key : getConfig().getKeys( false ) )
            {
                AttributeInstance instance = event.getPlayer().getAttribute( Attribute.valueOf( key ) );
                if ( instance != null )
                {
                    instance.setBaseValue( getConfig().getDouble( key, instance.getBaseValue() ) );
                }
            }
        }
    }
     

Recent Reviews

  1. Maxviq
    Maxviq
    3/5,
    Version: 1.0
    good plugin but this does not allow us to change knockback multiplier etc. add that and ill give 5 stars
  2. LudwigSchindler
    LudwigSchindler
    5/5,
    Version: 1.0
    You have hundreds of programming heart saved <3 and hundreds of serverowners :) Thank you for that.
  3. WoodyPlayzMC
    WoodyPlayzMC
    5/5,
    Version: 1.0
    I love the plugin works great
    Honestly was so worried about the update thanks you saved a bunch of servers including mine
  4. 8Marc8
    8Marc8
    5/5,
    Version: 1.0
    are yoυ ĸιddιng мe? aмazιng! yoυ ѕaved 100+ ѕerverѕ! ĸeep on worĸιng pleaѕe, ι love yoυr worĸ! wιтнoυт ѕpιgoт, we woυld вe ѕтιll on 1.7.9 ;-)
  5. DavidBBukkit
    DavidBBukkit
    5/5,
    Version: 1.0
  6. Terrobility
    Terrobility
    5/5,
    Version: 1.0
    Great plugin yet again! md_5, do me a favour and 5* my plugin called GiveMeHead and give me a cake badge too cos I'm fluffy on the inside and soft on the outside!
  7. _Kurimatzu_
    _Kurimatzu_
    5/5,
    Version: 1.0
    ---------------------------------------------------------------------------------------------
    WOOOOOOOOOOW , Very Good , YOU SAVED PVP COMMUNITY !
    ---------------------------------------------------------------------------------------------
  8. Frozon
    Frozon
    5/5,
    Version: 1.0
    Amazing! You saved the PVP community! You're the best. But now players can Swipe and Stun attack without having full charge :o
  9. TNTUP
    TNTUP
    5/5,
    Version: 1.0
    md_5 is the best ;) I hope there's a plugin which allows players to combat like in 1.8 on 1.9, and an option to toggle to 1.9 behavior
  10. flogic
    flogic
    5/5,
    Version: 1.0
    md_5 = bae, this will forever change how people use PVP and melee on their servers!!!! Can't wait to see what everyone does with this!