Jps21
5/30/2019 - 6:05 PM

Holograms

package com.supremewars.holograms;

import org.bukkit.plugin.java.JavaPlugin;

public final class Holograms extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        getCommand("hologram").setExecutor(new HologramCommand());

    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic

    }
}
package com.supremewars.holograms;

import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.ArmorStand;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;

public class HologramCommand implements CommandExecutor {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {

            Player player = (Player) sender;

            ArmorStand hologram = (ArmorStand) player.getWorld().spawnEntity(player.getLocation(), EntityType.ARMOR_STAND);

            hologram.setVisible(false);
            hologram.setCustomNameVisible(true);
            hologram.setCustomName(ChatColor.RED + "Hologram");
            hologram.setGravity(false);

            //Second Line

            ArmorStand hologram2 = (ArmorStand) player.getWorld().spawnEntity(player.getLocation().add(0,-0.5,0), EntityType.ARMOR_STAND);
            hologram2.setVisible(false);
            hologram2.setCustomNameVisible(true);
            hologram2.setCustomName(ChatColor.BLUE + "Second Line");
            hologram2.setGravity(false);

        }

        return true;
    }
}
name: Holograms
version: ${project.version}
main: com.supremewars.holograms.Holograms
api-version: 1.13
authors: [JackScott]
description: Holograms
website: supremewars.com
commands:
  hologram:
    description: Make a Hologram
    usage: </command>