Chest open animation

Discussion in 'Plugin Development' started by RFUDEO9EH, May 21, 2020.

  1. Offline

    RFUDEO9EH

    Hello, I try to keep chest open, I've already test:

    BlockPosition position = new BlockPosition(location.getX(), location.getY(), location.getZ());
    PacketPlayOutBlockAction packet = new PacketPlayOutBlockAction(position, Blocks.CHEST, 1, 1);
    for (Player p : Bukkit.getOnlinePlayers()) {
    ((CraftPlayer) p).getHandle().playerConnection.sendPacket(packet);
    }

    I've try too :

    playNote()

    and:

    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);

    I'm in 1.8.8
    but nothing work, no error in the console. Help me please.
     
    Last edited: May 21, 2020

Share This Page