@Override public void setVisible(boolean visible) { as.setVisible(visible); }
/** * Saves the ball asynchronously when it is inside of a chunk which gets unloaded. Replaces the entity with an invisible armorstands which holds the * ball information for respawning. * * @param event event */ @EventHandler public void onChunkSaveEvent(ChunkUnloadEvent event) { for (final Entity entity : event.getChunk().getEntities()) { final Optional<BukkitBall> ball; if (entity instanceof LivingEntity) { if ((ball = this.ballController.getBallFromEntity((LivingEntity) entity)).isPresent()) { if (ball.get().isPersistent()) { this.pushToCache(ball.get()); this.ballController.remove(ball.get()); this.ballController.saveAndDestroy(ball.get(), true); final ArmorStand armorStand = (ArmorStand) event.getWorld().spawnEntity(((Location) ball.get().getLocation()), EntityType.ARMOR_STAND); armorStand.setCustomNameVisible(false); armorStand.setRemoveWhenFarAway(false); armorStand.setVisible(false); armorStand.setCustomName("balluuid-" + ball.get().getUUID().toString()); } else { ball.get().remove(); } } } } }
if (invisible) { if (li instanceof ArmorStand) { ((ArmorStand)li).setVisible(false); } else { li.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1)); ((ArmorStand)li).setVisible(true); } else { li.removePotionEffect(PotionEffectType.INVISIBILITY);
as.setBasePlate(false); as.setGravity(false); as.setVisible(false); as.setCustomName(generatedName); as.setCustomNameVisible(true);
as.setBasePlate(false); as.setGravity(false); as.setVisible(false); as.setCustomName(generatedName); as.setCustomNameVisible(true);
public void createTimedHologram(final Location location, String text, Long timeout) { ArmorStand as = (ArmorStand) location.add(0.5, 1, 0.5).getWorld().spawnEntity(location, EntityType.ARMOR_STAND); //Spawn the ArmorStand as.setVisible(false); //Makes the ArmorStand invisible as.setGravity(false); //Make sure it doesn't fall as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it as.setCustomName(SavageFactions.plugin.color(text)); //Set this to the text you want as.setCustomNameVisible(true); //This makes the text appear no matter if your looking at the entity or not final ArmorStand armorStand = as; Bukkit.getScheduler().scheduleSyncDelayedTask(SavageFactions.plugin, () -> { armorStand.remove(); getLogger().info("Removing Hologram."); } , timeout * 20); }
as.setBasePlate(false); as.setGravity(false); as.setVisible(false); as.setCustomName(line); as.setCustomNameVisible(true);
as.setBasePlate(false); as.setGravity(false); as.setVisible(false); as.setCustomName(line); as.setCustomNameVisible(true);
@Override public SpellResult start(CastContext context) { MageController controller = context.getController(); Location location = adjustLocation(sourceLocation.getLocation(context)); ArmorStand armorStand = (ArmorStand)setEntity(controller, CompatibilityUtils.createArmorStand(location)); armorStand.setMarker(armorStandMarker); armorStand.setVisible(!armorStandInvisible); armorStand.setBasePlate(showArmorStandBaseplate); armorStand.setGravity(armorStandGravity); armorStand.setSmall(smallArmorStand); armorStand.setArms(showArmorStandArms); CompatibilityUtils.setSilent(armorStand, true); CompatibilityUtils.setDisabledSlots(armorStand, 2039552); update(armorStand); CompatibilityUtils.addToWorld(location.getWorld(), armorStand, spawnReason); return super.start(context); }
@Override public void apply(Entity entity) { if (!(entity instanceof ArmorStand)) return; ArmorStand armorStand = (ArmorStand)entity; armorStand.setItemInHand(itemInHand); armorStand.setBoots(boots); armorStand.setLeggings(leggings); armorStand.setChestplate(chestplate); armorStand.setHelmet(helmet); if (bodyPose != null) armorStand.setBodyPose(bodyPose); if (leftArmPose != null) armorStand.setLeftArmPose(leftArmPose); if (rightArmPose != null) armorStand.setRightArmPose(rightArmPose); if (leftLegPose != null) armorStand.setLeftLegPose(leftLegPose); if (rightLegPose != null) armorStand.setRightLegPose(rightLegPose); if (headPose != null) armorStand.setHeadPose(headPose); armorStand.setGravity(hasGravity); armorStand.setVisible(isVisible); armorStand.setArms(hasArms); armorStand.setSmall(isSmall); armorStand.setBasePlate(hasBasePlate); armorStand.setMarker(isMarker); CompatibilityUtils.setDisabledSlots(armorStand, disabledSlots); }
asL.setCustomNameVisible(false); asL.setGravity(false); asL.setVisible(false); asL.setLeftArmPose(new EulerAngle(90 * Math.PI / 180, 60 * Math.PI / 180, 0)); asL.getEquipment().setItemInOffHand(new ItemStack(Material.SHIELD)); asR.setCustomNameVisible(false); asR.setGravity(false); asR.setVisible(false); asR.setRightArmPose(new EulerAngle(90 * Math.PI / 180, 300 * Math.PI / 180, 0)); asR.getEquipment().setItemInMainHand(new ItemStack(Material.SHIELD)); asB.setCustomNameVisible(false); asB.setGravity(false); asB.setVisible(false); asB.setLeftArmPose(new EulerAngle(90 * Math.PI / 180, 270 * Math.PI / 180, 0)); asB.getEquipment().setItemInOffHand(new ItemStack(Material.SHIELD));
final int bannerCooldown = SavageFactions.plugin.getConfig().getInt("fbanners.Banner-Place-Cooldown"); final ArmorStand as = (ArmorStand) e.getBlockPlaced().getLocation().add(0.5, 1, 0.5).getWorld().spawnEntity(e.getBlockPlaced().getLocation().add(0.5, 1, 0.5), EntityType.ARMOR_STAND); //Spawn the ArmorStand as.setVisible(false); //Makes the ArmorStand invisible as.setGravity(false); //Make sure it doesn't fall as.setCanPickupItems(false); //I'm not sure what happens if you leave this as it is, but you might as well disable it
final TempArmorStand tas = new TempArmorStand(this.target.getLocation()); this.trap = tas.getArmorStand(); this.trap.setVisible(false); this.trap.setInvulnerable(false); this.trap.setSmall(true);