Changing an item for a specific player

Discussion in 'Plugin Development' started by gabrielmaennl555, Apr 22, 2018.

Thread Status:
Not open for further replies.
  1. Hello everyone!

    Is it possible to (in an open inventory, like a chest), make an item where only one player can see? overlapping another item?

    Im not so good at explaining things so here is an example:

    A chest plate in a chest, if a player right clicks it it changes to an iron block with a different name, lore etc...
    and if they right click it again, it turns back into the chest plate. Now while it is an iron block, I want it so if another player opens up the chest they see the chestplate not the iron block (and they can do it too, right click it to change it into the iron block etc...)

    Anyone know if this is possible and how I would do it? Thanks in advance!
     
  2. Offline

    JanTuck

  3. Offline

    Zombie_Striker

    @gabrielmaennl555
    This can be done through packets, like what @JanTuck . However, that is really over-complicating the problem.

    I'm assuming this is for an options-menu type feature, where its not that it actually needs to be the same inventory; it just needs to have the same buttons for all players that use it.

    If this is the case, what you want to do is create a new inventory for every player that uses the menu. Then, just add the chestplate or iron block when needed for that specific player.
     
    MightyOne likes this.
  4. @JanTuck

    I’ll look at that, thanks!


    @Zombie_Striker

    I’m making a system where players can right click any gear item and when they do do that it shows them the item stats, but I’m trying to make it so if the players are looking in the same chest in their base it doesn’t show the stats for the other person as well ;p, I didn’t explain that well considering I was tired sorry


    How would I use those packets to do this?
     
Thread Status:
Not open for further replies.

Share This Page