Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final Consumer<ArmorStand> consumer = armorStand -> {
- armorStand.setVisible(true);
- armorStand.setSmall(true);
- armorStand.setArms(true);
- CompProperty.GRAVITY.apply(armorStand, false);
- armorStand.setMarker(false);
- armorStand.setItemInHand(itemStack);
- };
- final Player player = event.getPlayer();
- final ArmorStand stand = player.getWorld().spawn(player.getLocation(), ArmorStand.class, consumer);
- final Location standLocation = stand.getLocation();
- final Location destination = player.getLocation().clone().add(0, 0.24, 0).add(player.getLocation().getDirection());
- final Vector vector = destination.subtract(player.getLocation()).toVector().add(new Vector(0, 0.4, 0));
- new BukkitRunnable() {
- @Override
- public void run() {
- final EulerAngle rotation = stand.getRightArmPose().add(20, 0, 0);
- stand.setRightArmPose(rotation);
- vector.add(new Vector(0, -0.08, 0));
- stand.teleport(standLocation.add(vector.normalize()));
- final Location armTipLocation = ArmourStandUtil.getSmallArmTip(stand);
- Common.runTimer(20, () -> CompParticle.VILLAGER_HAPPY.spawn(armTipLocation));
- }
- }.runTaskTimer(SimplePlugin.getInstance(), 0, 10);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement