Zombie Custom Name

Discussion in 'Plugin Development' started by ProStriker123, Sep 9, 2014.

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

    ProStriker123

    How can i do if the player is in the ArrayList "VIP" its will show him the Zombie displayname "Stats.VIP = ON" and if he is not in that arraylist then its will show him "Stats.VIP = OFF"
    My far away code is:
    Code:java
    1. Zombie z = (Zombie) player.getWorld().spawnEntity(player.getLocation(), EntityType.ZOMBIE);
    2. for(Player p : Bukkit.getOnlinePlayers()){
    3. List<String> vip = Banana.getStringList("VIP");
    4. z.setCustomName(vip.contains(p) ? "§2Stats: VIP = on" : "§2Stats: VIP = off");
    5. }
    6. z.setCustomNameVisible(true);


    Every help would be helpfuly and i will appreciate it :D
    Thanks!
     
  2. Offline

    ProStriker123

    its not working the player who looks at zombie its will change?
     
  3. ProStriker123 If the last person in the list happens to not be a VIP, it will display as no VIPs.
     
  4. Offline

    DevRosemberg

    Only way of doing this is packets i believe, PacketPlayOutEntityMetadata.
     
  5. ProStriker123 BananaBitchs Just relooked at this. Please learn basic Java. There is not situation in which your if statement will be true.
     
  6. Offline

    teej107

    ProStriker123
    Code:java
    1. Player p

    Code:java
    1. List<String> vip

    Code:java
    1. vip.contains(p)


    Those are hints.
     
Thread Status:
Not open for further replies.

Share This Page