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.

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

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 17, 2020
  4. 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);
        }
     
  5. Offline

    Jaaakee224

    @DarkBladee12
    BlockPosition isn't an import?

    So you have to use the craftbukkit jar.

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

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 17, 2020
  6. Offline

    DarkBladee12

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

    Dmrtje

  8. Offline

    Jaaakee224

  9. Offline

    sethrem

    @Jaaakee224 Are you trying to make mineplex treasure chests?
     
    Last edited: Jan 7, 2015
  10. 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