Show players visual chest open/close effect?

Discussion in 'Plugin Development' started by DarkBladee12, Dec 26, 2012.

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

    DarkBladee12

    Hey guys, how can I show all players that a chest is opening/closing? I tried it with Packet132TileEntityData, but I didn't manage to open the chest... Does anyone know a solution?
     
  2. Offline

    fireblast709

    player.openInventory()?
     
  3. Offline

    DarkBladee12

    fireblast709 I don't want the players to open an inventory! I mean the VISUAL chest open/close animation...

    Does no one know a solution? :( Or is it not possible?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  4. Offline

    MP5K

    hello DarkBladee12,
    i think (please correct me if i'm wrong) the Effect should be client side like the arm swing / clouds etc.
     
  5. Offline

    hockeygoalie5

    Here's an idea: Create a fake player entity and use it to open the chest. This way, no real player must open the chest and it will still open. Let me know if you can't figure out how to do and I'll give you some code!
     
  6. Offline

    psycowithespn

    You can do it through player.playNote(Location, byte, byte). The first byte is always 1 with a chest. The second byte is 1 if you want it to open and 0 if you want it to close. This does not play the chest opening sound, mind you.
     
  7. Offline

    hockeygoalie5

    He wants the chest to open visually, not just play the sound.
     
  8. Offline

    psycowithespn

    That is what i said, it does the animation, not the sound. The note packet controls the chest animation for some reason.
     
    WarmakerT and bobacadodl like this.
  9. Offline

    hockeygoalie5

    Oh, strange. Why call it on player, though? Does Block not have a playNote method? chest.playNote(chest.getLocation(), 1, (open == 1) ? (byte) 0 : (byte) 1);
     
  10. Offline

    fireblast709

    Its because the name is kinda misleading ;D
    DarkBladee12
    Code:java
    1. Packet54PlayNoteBlock packet = new Packet54PlayNoteBlock(x, y, z, 1, 1, 54);
     
  11. Offline

    DarkBladee12

    psycowithespn Thanks for the answer, I'll try that ;)

    psycowithespn works perfect!!! Thanks so much :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  12. Offline

    dillyg10

    This seems to not work on enderchests (IK old post) but it works on normal chests... For enderchests it will just play once, then immediately close.
     
  13. Offline

    DarkBladee12

    dillyg10 That's strange, but it's fine cause I only needed this for normal chests ;)
     
Thread Status:
Not open for further replies.

Share This Page