Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Open custom inventory (no fake tile hack)

Comments in 'Plugin Development' started by thebigsmileXD, Oct 4, 2015.

  1. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    I know, that already was discussed in https://forums.pocketmine.net/threads/opening-inventory.8955/page-2, but is there a different/better way to do it? The problem with the current code is you have to place a chest at 0 0 0, remove it and then restart the server. And you have to be in the chunk of 0 0 0 for it to work. Any ideas?
    And can you set the name of the chest? So that it shows up like on pc version when you rename a chest and open it? (Not "chest" standing on top but the chests name)
  2. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    i think, the best way is send some packets to player.

    first i save player coordinates and send BlockUpdatePacket with chest block (this works), then i send BlockEntityPacket with the same coordinates and then send ContainerOpenPacket with these coordinates. and onClose i remove block

    maybe i'll make some API for this. :D
  3. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    im recommending to make your own inventory class and fakeHolder class, and sendPackets in onOpen() and onClose() method
    Muqsit likes this.
  4. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    I did that. this all didnt work.
    applqpak likes this.
  5. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    also i dont want the players to see a chest
    applqpak likes this.
  6. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    It works for me :D and they dont :D if you spawn chest behind, above or 2 blocks under player :D
  7. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    If its glass? (It is in my case)
    applqpak likes this.
  8. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    When player closes the window, chest dissappear in few miliseconds (depends on ping)
  9. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Then its exactly the same like i currently have :p
    Also all that are no real fake inventories. They are "fake tiles" but directly send to the client. I wanted to open a window and handle everything inside the plugin. Transferring items etc
    applqpak likes this.

Share This Page

Advertisement