hey guys. i tried to make like a cowshooter, but when i type the command, it only says "/cowcannon" Code:JAVA public class cowcannon extends JavaPlugin { int cowtimer = 0; protected void run(CommandSender sender, Command cmd, final String[] args) throws Exception { Player player = (Player) sender; if (cmd.getName().equalsIgnoreCase("cowcannon")) { final Cow cow = (Cow) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE); if (cow == null) { return; } cowtimer = 2; cow.setVelocity(player.getEyeLocation().getDirection().multiply(3)); new BukkitRunnable() {@Override public void run() { if (cowtimer == 2) { final Location loc = cow.getLocation(); cow.remove(); loc.getWorld().createExplosion(loc, 4F); cowtimer--; } if (cowtimer == 1) { this.cancel(); } } }.runTaskTimer(this, 0L, 20L); } } } any ideas? Thank you!
final Cow cow = (Cow) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE); Thought you wanted cow?
yes yeah this was only for testing, but it always spawns nothing... EDIT by Moderator: merged posts, please use the edit button instead of double posting.