@Override public boolean setLocation(Location location) { org.bukkit.entity.Entity entity = entityRef.get(); if (entity != null) { return entity.teleport(BukkitAdapter.adapt(location)); } else { return false; } }
from.teleport(entity); sender.sendMessage( "Teleported " + CommandUtils.getName(from) + " to " + CommandUtils return false; } else { from.teleport(player); sender.sendMessage("Teleported " + CommandUtils.getName(from) + " to " + player.getName()); entity.teleport(destination); sender.sendMessage( "Teleported " + CommandUtils.getName(entity) + " to " + CommandUtils
destination.setYaw(entityLocation.getYaw()); entity.teleport(destination, PlayerTeleportEvent.TeleportCause.ENDER_PEARL);
targetLocation.setPitch(target.getLocation().getPitch()); target.teleport(targetLocation); sender.sendMessage( "Teleported " + target.getName() + " to " + targetLocation.getX() + " "
@Override public boolean teleport(Entity arg0) { return base.teleport(arg0); }
@Override public boolean teleport(Location arg0) { return base.teleport(arg0); }
public boolean teleport(Location location, TeleportCause cause) { return entity.teleport(location, cause); }
@Override public boolean teleport(Location arg0, TeleportCause arg1) { return base.teleport(arg0, arg1); }
@Override public boolean teleport(Entity arg0, TeleportCause arg1) { return base.teleport(arg0, arg1); }
@Override public boolean teleport(MCLocation location) { return e.teleport(((BukkitMCLocation) location).asLocation()); }
/** * {@inheritDoc} */ @Override public TeleportResult safelyTeleport(CommandSender teleporter, Entity teleportee, Location location, boolean safely) { if (safely) { location = this.getSafeLocation(location); } if (location != null) { if (teleportee.teleport(location)) { return TeleportResult.SUCCESS; } return TeleportResult.FAIL_OTHER; } return TeleportResult.FAIL_UNSAFE; }
@Override public boolean teleport(MCEntity destination) { Entity ent = ((BukkitMCEntity) destination).getHandle(); return e.teleport(ent.getLocation()); }
@Override public void run() { entity.teleport(location); registerForUndo(); playEffects("teleport"); } }, 1);
@Override public boolean teleport(MCLocation location, MCTeleportCause cause) { return e.teleport(((BukkitMCLocation) location).asLocation(), TeleportCause.valueOf(cause.name())); }
@Override public boolean teleport(MCEntity destination, MCTeleportCause cause) { return e.teleport(((BukkitMCEntity) destination).getHandle(), TeleportCause.valueOf(cause.name())); }
private boolean modifyPostSpawn(MageController controller, Entity entity) { if (entity == null || entity.getType() != type) return false; if (hasMoved && location != null && !location.equals(entity.getLocation())) { entity.teleport(location); } if (hasVelocity && velocity != null) { SafetyUtils.setVelocity(entity, velocity); } return true; }
@Override public void onRun() { Entity entity = getEntity(); if (entity == null) { cancel(); return; } Location loc = entity.getLocation(); loc.setYaw(loc.getYaw() + step); entity.teleport(loc); }
protected void teleportTo(Entity sourceEntity, Entity targetEntity) { Location targetLocation = targetEntity.getLocation(); // Try to place you in front of the other player, and facing them BlockFace targetFacing = getFacing(targetEntity.getLocation()); Location candidate = findPlaceToStand(targetLocation.getBlock().getRelative(targetFacing).getRelative(targetFacing).getLocation(), 4, 4); if (candidate != null) { candidate.setPitch(0); candidate.setYaw(360 - targetLocation.getYaw()); targetLocation = candidate; } sourceEntity.teleport(targetLocation); }
@Override public boolean onRightClick(ItemUseEvent e, Player p, ItemStack item) { if (SlimefunManager.isItemSimiliar(item, SlimefunItems.SCROLL_OF_DIMENSIONAL_TELEPOSITION, true)) { for (Entity n: p.getNearbyEntities(10.0, 10.0, 10.0)) { if (n instanceof LivingEntity && !(n instanceof ArmorStand) &&n.getUniqueId() != p.getUniqueId()) { float yaw = n.getLocation().getYaw() + 180.0F; if (yaw > 360.0F) yaw = yaw - 360.0F; n.teleport(new Location(n.getWorld(), n.getLocation().getX(), n.getLocation().getY(), n.getLocation().getZ(), yaw, n.getLocation().getPitch())); } } return true; } else return false; } });
@Override public void run() { if (Bukkit.getPlayer(uuid) == null) Bukkit.getScheduler().cancelTask(id); else if (Bukkit.getPlayer(uuid).isDead()) Bukkit.getScheduler().cancelTask(id); else if (!Bukkit.getPlayer(uuid).isSneaking()) Bukkit.getScheduler().cancelTask(id); else { for (Entity item: Bukkit.getPlayer(uuid).getNearbyEntities(6D, 6D, 6D)) { if (item instanceof Item) { if (!item.hasMetadata("no_pickup") && ((Item) item).getPickupDelay() <= 0) { item.teleport(Bukkit.getPlayer(uuid).getEyeLocation()); Bukkit.getPlayer(uuid).getWorld().playSound(Bukkit.getPlayer(uuid).getEyeLocation(), Sound.ENTITY_ENDERMAN_TELEPORT, 5L, 2L); } } } } }