Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(cmd.getName().equalsIgnoreCase("test")) {
- if(args[0].equalsIgnoreCase("fire")) {
- World w = getServer().getWorld("world");
- Location loc = new Location(p.getWorld(), p.getLocation().getX(), p.getLocation().getY(), p.getLocation().getZ());
- Creeper creeper = (Creeper) w.spawnEntity(loc, EntityType.CREEPER);
- creeper.setCustomName("§4Arrow Turret");
- creeper.addPotionEffect(new PotionEffect(PotionEffectType.SLOW, 10000000, 1000000000));
- Bukkit.getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
- @Override
- public void run() {
- Vector toTarget = p.getLocation().toVector().subtract(((Location) creeper).toVector());
- Vector vect = new Vector(toTarget.getX(), toTarget.getY(), toTarget.getZ());
- Vector direction = vect.multiply(3D);
- Arrow a = w.spawnArrow(creeper.getEyeLocation(), direction, 10, 0);
- for(Player all : Bukkit.getOnlinePlayers()) {
- all.sendMessage("§cZündung");
- }
- }
- }, 20, 20);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement