Solved Disable Collision 1.17

Discussion in 'Spigot Plugin Help' started by Casperhjdasz, Jun 27, 2021.

  1. Hi, I'm making a plugin where you can spectate in survival mode. I was trying to make the person non-colidable and invisible but this doesn't work.

    I'm using player.setVisible(false) and player.setCollidable(false), however, you can still see the item in the player's hand and you can still push and hit the invisible player. I have tried targetplayer(Everyone online with a for-loop).hidePlayer(player) but this doesn't seem to work either.

    I would like to keep the game mode survival for items in the Hotbar.

    if you know how to help me pls do!
    Thanks in advance!
    P.S. For more info pls ask, I have tried to write this in my best English but I'm not native so sorry for that.
     
  2. hidePlayer should work:unsure:
    also, you can't make players go through blocks unless they're in spectator mode (if that's what you meant by disabling collision, otherwise you can remove collision with other entities, yeah)
     
  3. I don't have to make people go thru walls just that they can't push each other, I tried hidePlayer but sadly it doesn't work

    ===========
    EDIT:
    for 1.17 I think there is a new method of hidePlayer where you need to give the plugin first, but this doesn't work either.
    <Player>.hidePlayer(Plugin, Player)
     
    • Creative Creative x 1
  4. What I mean is that the player cant see the hided player but he can still hit him, I don't know if this has anything to do with that in 1.17 hidePlayer() is decapitated.

    =============================================
    EDIT

    Never mind my error with hitting people is fixed, it was just my stupidness. I didn't hide the player for everybody just for the offline player and not the online players.:oops: This explained a lot.

    Thanks for the help with collisions, It means a lot!
     
    #5 Casperhjdasz, Jun 27, 2021
    Last edited: Jun 28, 2021