ModsJava
AttributeDemo
Java mod listed for Minecraft 1.9. Download on the author's site.
⬇ Download on Spigot*** 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.
Source Code:
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
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 ( ) ) ) ;
}
}
}
}
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 ( ) ) ) ;
}
}
}
}
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.9
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
AttributeDemo is a free Minecraft Java mod. Compatible with Minecraft 1.9. Downloaded 1,206 times (via Spigot). Download it and open it directly in the game.