Placing blocks where invisible players are

Discussion in 'Plugin Development' started by dark navi, Aug 3, 2013.

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

    dark navi

    Hey guys, trying to make it so spectators of our game are truly invisible.

    I am trying to make it so you can place blocks even if a spectator is occupying a block by essentially looping through all of the players and moving spectators if they are too close to the block.

    My issue is that the BlockPlaceEvent isn't even getting fired when I try to place a block where an invisible person is standing. My block simply appears and disappears without an place event firing.

    Any thoughts on mitigating this would be much appreciated!
     
  2. Offline

    krazytraynz

    You could try moving them backwards on PlayerInteractEvent, if it's called before BlockPlaceEvent. Check if they have a Block in their hand, and if they right click a block. If both of those are true, check if there's a player above the clicked block and teleport them if there is.
     
  3. Offline

    hayhaycrusher

    How are you making the player invisible?

    You shouldn't use the method add potion effect for this.

    you should use player1.hideplayer(player2);

    So using this it would stop player1 from seeing player2, by using a potion effect it just makes the player invisible not actually get rid of them. by using hideplayer it would get rid of them completely for that player, making them able to place blocks.

    if you are using hideplayer i have no idea.
     
  4. Offline

    dark navi



    Of course I am using hidePlayer. ;) But even though PlayerA can't see PlayerB, the server is too dumb to know that PlayerA should be able to place blocks at PlayerB's location.

    I'll take a whack at the issue with @krazytraynz's idea.
     
Thread Status:
Not open for further replies.

Share This Page