Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Player#hideEntity/Player#hidePlayer and Entity#setVisibleByDefault on player should allow not removing player's name from player list

Open GliczDev opened this issue 2 years ago • 5 comments

Is your feature request related to a problem?

I think it'd be very useful for only hiding players without removing them from player list

Describe the solution you'd like.

Something like: player.hideEntity(plugin, player2, false) player.hidePlayer(plugin, player2, false) player2.setVisibleByDefault(false, false)

Describe alternatives you've considered.

-

Other

No response

GliczDev avatar Mar 25 '23 13:03 GliczDev

I needed this, it's quite annoying that bukkit API has extra packet sending to hide the player from tablist

KabanFriends avatar Mar 25 '23 17:03 KabanFriends

I very much agree with the above mentioned suggestions.

JakeGBLP avatar Apr 08 '23 15:04 JakeGBLP

Hi, I made some changes to the code and I think it works, but idk until i can test it... maybe anyone who can help?

JMBoy01 avatar May 25 '23 11:05 JMBoy01

I expected Player.hideEntity() to keep player listed in tab. I tried working around this using Player.listPlayer(), however you can't list hidden players. (I am getting IllegalStateException("Player cannot see other player")). If someone have a workaround until this is worked on, i would be glad to take it.

XxGoldenbluexX avatar Jan 10 '24 17:01 XxGoldenbluexX

It's a little trickly. hideEntity and hidePlayer do the same thing right now, and hidePlayer has existed WAY longer and plugins rely on that completely removing the Player from connected clients. If we reversed course and made it so it didn't completely remove other players, then vanish abilities would be broken as any client would still know that player was online.

Since just separate tab list hide was added pretty recently by mojang, I think new API is better for that instead of changing the behavior of these existing methods

Machine-Maker avatar Jan 10 '24 18:01 Machine-Maker

I expected Player.hideEntity() to keep player listed in tab. I tried working around this using Player.listPlayer(), however you can't list hidden players. (I am getting IllegalStateException("Player cannot see other player")). If someone have a workaround until this is worked on, i would be glad to take it.

Hi, would @XxGoldenbluexX idea be aligned with the principle (mentionned by @Machine-Maker) that hidePlayer behavior should not be changed ? Do some plugins really use Player.hideEntity expecting it to hide a player from the tab list? If so, then would adding another function Player.hidePlayer(Plugin plugin, Player player, boolean hideFromList) (while keeping the original Player.hidePlayer(Plugin plugin, Player player)) do the job?

Hy3z avatar Mar 31 '24 18:03 Hy3z