๐ฎPowerup API
public class MyPowerup extends Powerup {
public MyPowerup(String configIdentifier, Location location, long interval) {
super(configIdentifier, location, interval);
}
@Override
protected Item respawnPowerup(Location location) {
return null;
}
@Override
protected void onPlayerPickup(Player player) {
}
}public class MyPowerup extends Powerup {
public MyPowerup(Location location, long interval) {
super("MYPOWERUP", location, interval);
}
@Override
protected Item respawnPowerup(Location location) {
Item item = location.getWorld().dropItem(location, new ItemStack(Material.BLAZE_POWDER));
item.setVelocity(new Vector(0, 0, 0));
item.teleport(location.clone().add(.5, 0, .5));
return item;
}
@Override
protected void onPlayerPickup(Player player) {
GamePlayer.get(player).setMana(99);
player.sendMessage(ChatColor.RED + "Filled your mana!");
}
}Last updated