This is a new API that was added in Spigot 1.9 and can be used to change things like the attack speed of a player.
All possible attributes are listed here: http://minecraft.gamepedia.com/Attribute#Attributes_available_on_all_living_entities
This probably isn't enough stuff for a single addon but I think it would fit into Skellett or skUtilities. Maybe @tim740 or @LimeGlass could add this?
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() ) );
}
}
}
}
All possible attributes are listed here: http://minecraft.gamepedia.com/Attribute#Attributes_available_on_all_living_entities
This probably isn't enough stuff for a single addon but I think it would fit into Skellett or skUtilities. Maybe @tim740 or @LimeGlass could add this?