Chest Open Animation

Discussion in 'Plugin Development' started by Jaaakee224, Jan 4, 2015.

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

    Jaaakee224

    How would I do the chest open animation and keep it open like this?
    [​IMG]

    Much Appreciated :)
     
  2. Offline

    teej107

  3. Offline

    Jaaakee224

    @teej107
    Yeah, I tried that. It makes a some what thump sound instead of what it was said of doing. I saw one thread that it can be done by using PacketPlayOutBlockAction, I'm just checking to make sure there is no other way.
     
  4. Offline

    nverdier

    @Jaaakee224 From what I know, that's the way to do it.
     
  5. Offline

    DarkBladee12

    @Jaaakee224

    You can either do it with the packet or use the method of the NMS world class. I just played around with that and found out how to do it:

    Code:
        public static void playChestAction(Chest chest, boolean open) {
            Location location = chest.getLocation();
            World world = ((CraftWorld) location.getWorld()).getHandle();
            BlockPosition position = new BlockPosition(location.getX(), location.getY(), location.getZ());
            TileEntityChest tileChest = (TileEntityChest) world.getTileEntity(position);
            world.playBlockAction(position, tileChest.w(), 1, open ? 1 : 0);
        }
     
  6. Offline

    Jaaakee224

  7. Offline

    nverdier

    So you have to use the craftbukkit jar.
     
  8. Offline

    Jaaakee224

    @nverdier
    Yeah, I just tried that. No dice.
     
  9. Offline

    DarkBladee12

    @Jaaakee224 What version are you using? My method only works for 1.8!
     
  10. Offline

    Dmrtje

  11. Offline

    Jaaakee224

  12. Offline

    sethrem

    @Jaaakee224 Are you trying to make mineplex treasure chests?
     
    Last edited: Jan 7, 2015
  13. Offline

    Jaaakee224

    @sethrem
    Somewhat, yes. For now, I am trying to add the chest open animation to a current project I am working on.
     
Thread Status:
Not open for further replies.

Share This Page