Want to make it so that one player sees one half of the world and the other sees the other half.

Discussion in 'Spigot Plugin Help' started by ski5, Mar 9, 2021.

  1. Is there anyway to make it so that one player can only view the north side of the world and the other only sees the south side. I am very new to coding spigot plugins and coding in general so any help would be appreciated!
     
  2. I don't think you can hide blocks or chunk from players, but you can set up regions with worldguard and give it a permission. Create a group with any permission plugins. Some players won't be able to enter that region, while others can.
     
  3. Or add a blindness to the player if it gets too close to the border.
     
  4. You can definitely hide chunks from a player. All information of how the world looks has to be communicated with the player (which is done in the form of packets), so all you need to do is intercept and cancel some packets.

    I highly advise you to use ProtocolLib for this, it will make it a lot easier. Listen for the chunk data packet. You can read out the first two integers using ProtocolLib, these will be the x and z chunk coordinate respectively. Use them to decide if the player is allowed to see the chunk (only allowing positive x for example hides half the map).

    Now the above implementation works best (by far) if you don’t have to switch what chunks a player can see while they are in the same world, so you can start hiding chunks as soon as they start receiving them. If it is a for a minigame for example, it would help if you do it in a separate world so you can start blocking chunk visibility as soon as they get there. It is also possible to dynamically hide chunks and make them visible again. I made a dummy plugin that was somewhat successful, but it might have slight issues with lightning updates etc.