Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void moveStand(final Player player) {
- final Location destination = player.getLocation().clone().add(0, 0.5, 0).add(player.getLocation().getDirection().multiply(5));
- final Vector vector = destination.subtract(player.getLocation()).toVector();
- final Consumer<ArmorStand> consumer = armorStand -> {
- armorStand.setVisible(false);
- armorStand.setSmall(true);
- CompProperty.GRAVITY.apply(armorStand, true);
- armorStand.setMarker(false);
- };
- final ArmorStand stand = player.getWorld().spawn(player.getLocation(), ArmorStand.class, consumer);
- new BukkitRunnable() {
- @Override
- public void run() {
- vector.add(new Vector(0, descendValue, 0));
- stand.teleport(stand.getLocation().add(vector.normalize()));
- }
- }.runTaskTimer(SimplePlugin.getInstance(), 0, 2);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement