New command /fireball

This commit is contained in:
snowleo 2011-06-23 14:14:24 +02:00
parent c378d98b0f
commit efaed85188
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,24 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import org.bukkit.Server;
import org.bukkit.entity.Fireball;
import org.bukkit.util.Vector;
public class Commandfireball extends EssentialsCommand
{
public Commandfireball()
{
super("fireball");
}
@Override
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
{
charge(user);
final Vector direction = user.getEyeLocation().getDirection().multiply(2);
user.getWorld().spawn(user.getEyeLocation().add(direction.getX(), direction.getY(), direction.getZ()), Fireball.class);
}
}

View File

@ -76,6 +76,10 @@ commands:
description: Extinguish players. description: Extinguish players.
usage: /<command> <player> usage: /<command> <player>
aliases: [extinguish] aliases: [extinguish]
fireball:
description: Throw a fireball.
usage: /<command>
aliases: [efireball]
getpos: getpos:
description: Get your current coordinates. description: Get your current coordinates.
usage: /<command> usage: /<command>