Util Add invisibility potion to player without particles displayed!

Discussion in 'Resources' started by mine-care, Mar 28, 2015.

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

    mine-care

    Hello there, i am making a fully custom KitPvP server (in terms of plugins) and i was looking for a way to make a kit allowing a player to be invisible without particles arround him (that apear with normal invisibility potion) and to allow other players to hit the invisible player.

    What makes this different from "player#hidePlayer(Player param);" ?
    If a player is turn invisible with the method above, others are unable to hit him/her, this is a problem when it comes to my kit where i want a player to be fully invisible but at the same time allow others to cause damage to that player.

    How to do it:
    Code:
    Player p = ...; // declare your player object
    Entity en = (Entity) (CraftPlayer)p).getHandle();
            en.setInvisible(boolean param); // make player invisible depending on provided boolean;
    
    I will make a version independed method as well.

    This might seem as if it is a litle util mostly useless, but in cases like the one provided avove its really helpful Also i plan on extending this thread to how to add potion effects without particles.
    Thanks for reading!
     
  2. Offline

    ChipDev

    Another awesome way to do something others would never find out!
    Just make a thread on how to do everything in the world next. :p
     
    GrandmaJam and mine-care like this.
  3. Offline

    mine-care

    @ChipDev I wish I could! Thanks for the feedback btw =D
     
    GrandmaJam and ChipDev like this.
  4. Another great resource by @mine-care, I think you are getting close to the number of resources that @ChipDev has.
     
    Goblom, GrandmaJam, Skionz and 2 others like this.
  5. Offline

    mine-care

    ChipDev likes this.
  6. Offline

    ChipDev

    Don't even talk about it..
    *Runs and hides*
     
    mine-care likes this.
  7. Offline

    mine-care

    @ChipDev
    Why dude! your tutorials/recources and generally posts are on the spot!
    *Chases and finds*
     
    ChipDev likes this.
  8. Offline

    mrCookieSlime

    @mine-care
    There are not much Threads to find to be honest.
    80% locked and 19% deleted, only about 1% left ^^

    To be precise:

    Locked: 4 / 11 ( ~37% )
    Deleted 3 / 11( ~26% )
    Open: 4 / 11( ~37% )
     
    Last edited: Mar 29, 2015
  9. Offline

    mine-care

  10. Offline

    mrCookieSlime

    I was just saying that ChipDev might have a lot of Resources but not a lot of them will be able to be found by you.

    Anyway, back ontopic now.
     
  11. Offline

    mine-care

    @mrCookieSlime Oh, i have seen them though :p not the deleted ones obviusly but locked and open ones i have seen :- )
    Thanks for the info.
     
  12. Offline

    Phasesaber

    Code:
    ((Entity) (((CraftPlayer)p).getHandle())).setInvisible(boolean param);
    Your parentheses looked off, so I added 27,251 more.
     
    Last edited: Mar 31, 2015
    GrandmaJam likes this.
  13. Offline

    mine-care

    @Phasesaber oh yes they are off a bit because it was typed by hand from my phone... ill fix them, your version is a bit too one-lined, it does not really help people read it :3 although it is the exact same as the one above. ill fix it thx! =)
    Oh and for code, click on the insert button on the edit bar^ (before to the save button) and click code :p or use [c0de][/c0de] tags (with o not 0)
     
Thread Status:
Not open for further replies.

Share This Page