1.7.10 Invisible Nameplates?

Discussion in 'Plugin Development' started by Coolgamer54, Aug 31, 2015.

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

    Coolgamer54

    Is there a way for me to set make a player's nameplate invisible?

    (Keeping it in the crouch state could work, but invisible is the goal)
     
  2. Offline

    mine-care

    @Coolgamer54 I dont really think so, You can force them to sneak though without noticing any slowdown or anything.
     
  3. Offline

    Coolgamer54

    I know its possible cause of a few reasons, 1: There used to be a plugin that went way outdated thet you could do that, Also, on Mineplex's game "Minestrike" Players names are always in the crouch state so that they are invisible throught walls.

    Could there be a way that we can make the game think they are crouching but they are moving the same speed and they don't look like they are crouching? That way the name is in the crouching state.
     
  4. Offline

    mine-care

    @Coolgamer54
    1. it was possible in past versions as well as changing the name and the color and so on
    2. thats what i recomended. There is a datawatcher value i think for that :/ Hmm i need to find it thouhg...
     
  5. Offline

    Coolgamer54

    Keep in mind, this plugin is for 1.7.10!
     
  6. Offline

    Konato_K

    @Coolgamer54 Faking the player to crouch can be done with packets and so on.

    If you want the nametags to be actually invisible it's only possible in 1.8 by using scoreboards, in 1.7 and previous using the sneak-trick may be good, but it's also possible to use TagAPI to make the nametags "empty" and less visible, they will still render though.
     
  7. Offline

    Coolgamer54

    How would i go about doing the sneak trick?
     
  8. Offline

    Coolgamer54

    Bump!!

    Still not Resolved
     
  9. Offline

    boomboompower

    No I have made it so when they leave they get their name back.
    Also it won't work for 1.7.10, so he will have to find a different option.
    Nevermind
    I get what you were saying will fix.

    Code:
    public void Quit(PlayerQuitEvent e) {
            Player p = e.getPlayer();
            p.setCustomName(p.getName);
    }
    EDIT by Timtower: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Sep 3, 2015
  10. Offline

    Coolgamer54

    No, I want to know how to change the Player's Nameplate above their head so thats its invisible or at most, in the crouch state
     
  11. Offline

    Keubix

    Isn't there a way to make the player stop sending the nameplate packets? Or is that not a thing xD.
     
    Coolgamer54 likes this.
  12. Offline

    mine-care

    @Keubix there is no specific packet for nametag, if there was we could send it to override the current name.
    now it is handled by the client...
     
  13. Offline

    Keubix

    Is it possible for the clients to send a different nematag packet then? If so, I'm surprised that isn't seen in hacked clients.
     
  14. Offline

    stormneo7

    Code:
    @EventHandler
    public void onToggleSneak(PlayerToggleSneakEvent evt) {
        final Player p = evt.getPlayer();
        if(!evt.isSneaking())
            sendSneakPacket(p);
    }
      
    @EventHandler
    public void onJoin(PlayerJoinEvent evt) {
        final Player p = evt.getPlayer();
        sendSneakPacket(p);
    }
      
    public static void sendSneakPacket(Player p) throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
        DataWatcher dw = ((CraftLivingEntity) p).getHandle().getDataWatcher();
        dw.watch(0, (Byte) (byte) 0x02);
    
        PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(p.getEntityId(), dw, true);
    
        for (Player t : Bukkit.getOnlinePlayers())
            ((CraftPlayer) t).getHandle().playerConnection.sendPacket(packet);
    }
     
  15. Offline

    Coolgamer54

    Thanks but it gives me a few a few errors like Incorrect Types.
     
  16. Offline

    sethrem

    Scoreboard is the best way to do this it's how mineplex does it
     
  17. Offline

    Coolgamer54

    I'm trying to avoid having things on the screen in general
     
  18. Offline

    stormneo7

    What're your imports using that snippet?
     
  19. Offline

    Coolgamer54

    Its not giving me the option to Import anything

    What do i need to import?
     
    Last edited: Sep 5, 2015
  20. Offline

    Coolgamer54

    Bump! Update!

    Using what Stormneo gave me, nothing happens in game. Can somone help please?

    Code:
    package me.nometa;
    
    import org.bukkit.Bukkit;
    import org.bukkit.craftbukkit.v1_7_R3.entity.CraftLivingEntity;
    import org.bukkit.craftbukkit.v1_7_R3.entity.CraftPlayer;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerToggleSneakEvent;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import net.minecraft.server.v1_7_R3.DataWatcher;
    import net.minecraft.server.v1_7_R3.PacketPlayOutEntityMetadata;
    
    public class NoMetarino extends JavaPlugin {
    
        public void onEnable() {
            getLogger().info("The No Metarino plugin, Created by Zac Dunn, Has been activated!");
        }
    
        @EventHandler
        public void onToggleSneak(PlayerToggleSneakEvent evt){
            final Player p = evt.getPlayer();
            if (!evt.isSneaking())
                sendSneakPacket(p);
        }
    
        @EventHandler
        public void onJoin(PlayerJoinEvent evt){
            final Player p = evt.getPlayer();
            sendSneakPacket(p);
        }
    
        public static void sendSneakPacket(Player p){
            DataWatcher dw = ((CraftLivingEntity) p).getHandle().getDataWatcher();
            dw.watch(0, (Byte) (byte) 0x02);
    
            PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(p.getEntityId(), dw, true);
    
            for (Player t : Bukkit.getOnlinePlayers())
                ((CraftPlayer) t).getHandle().playerConnection.sendPacket(packet);
    
        }
    
        public void onDisable() {
            getLogger().info("The No Metarino plugin, Created by Zac Dunn, Has been disabled!");
        }
    }
     
  21. Offline

    Coolgamer54

    Bump!!!

    Still not Resolved
     
  22. Offline

    RoboticPlayer

    You are
    A) Not implementing listener
    B) Not registering your events.
    THAT is why it's not working!
     
  23. Offline

    Petersoj

    @Coolgamer54 You could use teams with the scoreboard and make it so only your own team can see your name tag.
    Code:
    team.setNameTagVisibility(NameTagVisibility.HIDE_FOR_OTHER_TEAMS);
    
     
  24. Offline

    Coolgamer54

    Okay so it works now but not only are the names In the crouch state, The player is also crouching, How could i fix that?


    That does not work...
     
  25. Offline

    Coolgamer54

  26. Offline

    Coolgamer54

Thread Status:
Not open for further replies.

Share This Page