mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-07 15:16:41 +02:00
Will be removed until the next release XD
This commit is contained in:
@@ -0,0 +1,44 @@
|
|||||||
|
package com.earth2me.essentials.commands;
|
||||||
|
|
||||||
|
import com.earth2me.essentials.Mob;
|
||||||
|
import com.earth2me.essentials.User;
|
||||||
|
import java.util.Random;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Server;
|
||||||
|
import org.bukkit.entity.Ocelot;
|
||||||
|
|
||||||
|
|
||||||
|
public class Commandkittycannon extends EssentialsCommand
|
||||||
|
{
|
||||||
|
private static Random random = new Random();
|
||||||
|
|
||||||
|
public Commandkittycannon()
|
||||||
|
{
|
||||||
|
super("kittycannon");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception
|
||||||
|
{
|
||||||
|
final Mob cat = Mob.OCELOT;
|
||||||
|
final Ocelot ocelot = (Ocelot)cat.spawn(user, server, user.getEyeLocation());
|
||||||
|
if (ocelot == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final int i = random.nextInt(Ocelot.Type.values().length);
|
||||||
|
ocelot.setCatType(Ocelot.Type.values()[i]);
|
||||||
|
ocelot.setTamed(true);
|
||||||
|
ocelot.setVelocity(user.getEyeLocation().getDirection().multiply(2));
|
||||||
|
ess.scheduleSyncDelayedTask(new Runnable()
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public void run()
|
||||||
|
{
|
||||||
|
final Location loc = ocelot.getLocation();
|
||||||
|
ocelot.remove();
|
||||||
|
loc.getWorld().createExplosion(loc, 1f);
|
||||||
|
}
|
||||||
|
}, 20);
|
||||||
|
}
|
||||||
|
}
|
@@ -186,6 +186,9 @@ commands:
|
|||||||
description: Kill all mobs in a world.
|
description: Kill all mobs in a world.
|
||||||
usage: /<command> [mobType] [radius]
|
usage: /<command> [mobType] [radius]
|
||||||
aliases: [ekillall,butcher,ebutcher]
|
aliases: [ekillall,butcher,ebutcher]
|
||||||
|
kittycannon:
|
||||||
|
description: Throw an exploding kitten at your opponent
|
||||||
|
usage: /<command>
|
||||||
list:
|
list:
|
||||||
description: List all online players.
|
description: List all online players.
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
|
Reference in New Issue
Block a user