Advertisement
JackOUT

Untitled

Feb 18th, 2022 (edited)
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1.     public void moveStand(final Player player) {
  2.         final Location destination = player.getLocation().clone().add(0, 0.5, 0).add(player.getLocation().getDirection().multiply(5));
  3.         final Vector vector = destination.subtract(player.getLocation()).toVector();
  4.  
  5.         final Consumer<ArmorStand> consumer = armorStand -> {
  6.             armorStand.setVisible(false);
  7.             armorStand.setSmall(true);
  8.             CompProperty.GRAVITY.apply(armorStand, true);
  9.             armorStand.setMarker(false);
  10.         };
  11.  
  12.         final ArmorStand stand = player.getWorld().spawn(player.getLocation(), ArmorStand.class, consumer);
  13.  
  14.         new BukkitRunnable() {
  15.             @Override
  16.             public void run() {
  17.                     vector.add(new Vector(0, descendValue, 0));
  18.                     stand.teleport(stand.getLocation().add(vector.normalize()));
  19.             }
  20.         }.runTaskTimer(SimplePlugin.getInstance(), 0, 2);
  21.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement