Separate Names for Armor Stands

Discussion in 'Plugin Development' started by MrGriefer_, Nov 17, 2016.

Thread Status:
Not open for further replies.
  1. Offline



    I'm working on a new mini game that got kits that could be selected through Armor Stands but I'm trying to make one of the kits cost money. So if a player buys the kit the Armor Stand will change name to: {kit} - Bought
    But how could I make it so other players that didn't bought the kit will have their Armor Stand named to: {kit} - Amount ?
  2. Offline


    I'm not entirely understanding, do you mean displaying armor stands in an inventory, or a placed physical armor stand?
    Either way it would be per-player, rather than making things static if that's what you're trying.
    So if you're going the inventory route, on retrieval of the items, you would check the config to see if they've purchased the item, making the text display differently depending on the outcome.
  3. Offline


    Placed armor stand not inventory armor stand
  4. Offline


    Something similar like Mineplex kits when someone buys a kit it will change the entity name to green and red for players who didn't bought the kit.
  5. Offline


  6. Offline


    You're looking for custom names per player?
  7. Offline


  8. Offline


    By using packets and only sending it to the player. I have a hologram library (all you have to do is paste the following 2 classes in your project) if you want to use it: (If you do not want the armor stands to be invisible just modify the code when it builds the entity)
    Hologram class:
        public void onPlayerChat(AsyncPlayerChatEvent e) {
    ArrayList<String> messages = new ArrayList(Arrays.asList(ChatColor.AQUA + "A","B", "Line 3"));
            Hologram hg = new Hologram(messages, e.getPlayer().getLocation());
            getServer().getScheduler().runTaskLater(this, new Runnable(){
                public void run(){
                    hg.addLine("Line 4").rebuild().sendHologram(e.getPlayer());
            }, 100);
    Last edited: Nov 22, 2016
  9. Offline


    Thank you for the library, but I'm getting an error in the console:

    [16:30:10] [Server thread/WARN]: java.lang.NoSuchMethodException: net.minecraft.server.v1_10_R1.EntityArmorStand.setGravity(boolean)
    [16:30:10] [Server thread/WARN]:     at java.lang.Class.getMethod(Unknown Source)
    [16:30:10] [Server thread/WARN]:     at
    [16:30:10] [Server thread/WARN]:     at timebomb.Core.onCommand(
    [16:30:10] [Server thread/WARN]:     at org.bukkit.command.PluginCommand.execute(
    [16:30:10] [Server thread/WARN]:     at org.bukkit.command.SimpleCommandMap.dispatch(
    [16:30:10] [Server thread/WARN]:     at org.bukkit.craftbukkit.v1_10_R1.CraftServer.dispatchCommand(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.PlayerConnection.handleCommand(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.PlayerConnection.a(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.PacketPlayInChat.a(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.PlayerConnectionUtils$
    [16:30:10] [Server thread/WARN]:     at java.util.concurrent.Executors$ Source)
    [16:30:10] [Server thread/WARN]:     at Source)
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.SystemUtils.a(SourceFile:45)
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.MinecraftServer.D(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.DedicatedServer.D(
    [16:30:10] [Server thread/WARN]:     at net.minecraft.server.v1_10_R1.MinecraftServer.C(
    [16:30:10] [Server thread/WARN]:     at
    [16:30:10] [Server thread/WARN]:     at Source)
    My server is on 1.10.2. When I remove line that says
    no errors appear.
Thread Status:
Not open for further replies.

Share This Page