Solved Completely hiding a player

Discussion in 'Plugin Development' started by JimsHD, Apr 26, 2015.

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

    JimsHD

    So I'm currently making a 1v1 plugin for my server. The way it works is there is one arena(set in the config) and multiple players can duel each other in the one arena. I use

    Code:
    for(Player all : Bukkit.getOnlinePlayers()){
                                                if(p.canSee(all) || target.canSee(all)){
                                                    all.hidePlayer(p);
                                                    p.hidePlayer(all);
                                                    all.hidePlayer(target);
                                                    p.hidePlayer(target);
                                                }
                                            }
    for hiding the players, and yes I do show the target after that. It works fine except when other players are dueling at the same time I can still see them throwing potions, hear them and they can still be hit. How do I fix this?
     
  2. Offline

    RawCode

    1) hide potions
    2) mute sounds
    3) cancel damage from other players

    all answers already inside your question
     
  3. Offline

    travja

    If you really want to make this work in the best way possible, you'd need to go into a lot of in depth code and use Reflection to cancel packets sent to other clients except the ones dueling. These packets include player packets, potions involved, sprinting particles, etc.
     
  4. Offline

    mythbusterma

    @travja

    Why would you use reflection to do this? Just use ProtocolLib.


    @JimsHD

    Do what RawCode says, if you want it even more in depth, you can use ProtocolLib to make sure that other players won't appear to the ones in the arena, although that will be a whole lot of work.
     
  5. Offline

    travja

    If he's ok using ProtocolLib, then great, but if he'd rather not be dependent on anything else, Reflection is the way to go.
     
  6. Offline

    mythbusterma

    @travja

    How does reflection play into this? You don't need reflection to use NMS (and REALLY shouldn't if you do so).
     
    Konato_K likes this.
  7. Offline

    JPG2000

    *coughs* decompile vanish no packet *coughs*
     
  8. Offline

    JimsHD

  9. Offline

    RawCode

    using NMS based library is same as using NMS directly
    using NMS based API is same as using NMS directly

    probably netty hijack is not *NMS* but also it is not bukkit api ever remotely.
     
Thread Status:
Not open for further replies.

Share This Page