Rise 5.99 NoGuiClose module 2 files, 40 lines

Rise 5.99 NoGuiClose: Full Source Analysis

NoGuiClose is a single-condition receive-side cancel: onPacketReceive drops every S2EPacketCloseWindow while the current screen is a chat window, or unconditionally when the Chat Only toggle is off.

dev/rise/module/impl/other/NoGuiClose.java · GitHub source ↗

Published 2026-08-13 · Updated 2026-08-13

Packets This Module Uses

Analysis

Overview

NoGuiClose is a single-condition receive-side cancel: onPacketReceive drops every S2EPacketCloseWindow while the current screen is a chat window, or unconditionally when the Chat Only toggle is off. The vanilla handler the module intercepts (NetHandlerPlayClient.handleCloseWindow, which calls EntityPlayerSP.func_175159_q and then displayGuiScreen(null)) closes whatever screen is up, chat included, so a server that forces window closes mid-typing kills the player's message. Cancelling the packet keeps the screen alive. Two facts bound what the module can do on the wire: vanilla never echoes C0D in response to S2E (the close packet is only sent by EntityPlayerSP.closeScreen when the player closes a screen themselves), and chat is not a window at all, so the default Chat Only mode changes nothing on the C0D channel and the module is nearly wire-silent.

Receive-side interception

The whole module is one instanceof check in onPacketReceive: S2EPacketCloseWindow plus a screen test. With Chat Only at its default true, the cancel fires only while mc.currentScreen is a GuiChat, so a server-initiated window close that would yank the player out of typing is dropped and the chat stays open. With Chat Only off, every S2E is dropped regardless of screen, which also keeps containers open past the server's close. The setting is a BooleanSetting read directly in the condition, so there is no other state, no timer and no send path anywhere in the class.

Vanilla close contract

The fork's vanilla tree defines what the cancel actually prevents. handleCloseWindow calls func_175159_q, which nulls the carried item stack, calls super.closeScreen and displayGuiScreen(null); it sends no packet. C0DPacketCloseWindow is emitted only from EntityPlayerSP.closeScreen with openContainer.windowId, which the client runs when the player closes a screen through the GUI. So the server's S2E never produces a C0D echo in vanilla, and NoGuiClose does not suppress one: the C0D traffic the server sees is unchanged in every mode. The only divergence the module creates is the client-side screen state, which stays open against a server that believes it closed the window.

Server-side footprint

With the default Chat Only mode the wire effect is close to zero: chat is not an inventory window, the server tracks no window id for it, and the player simply keeps sending C01 chat messages that would otherwise have been interrupted. With Chat Only off the divergence is structural: the server closed the window (S2E) and the client keeps the container open, so subsequent C0E clicks reference a window the server has already discarded; vanilla processClickWindow ignores clicks for unknown window ids, but server-side window ledgers see clicks arriving against a closed-window state, and the C0D the player eventually sends on closing marks an already-closed window.

source NoGuiClose.java

NoGuiClose.java26 lines · JavaOriginal ↗
1
/*
2
 Copyright Alan Wood 2021
3
 None of this code to be reused without my written permission
4
 Intellectual Rights owned by Alan Wood
5
 */
6
package dev.rise.module.impl.other;
7
8
import dev.rise.event.impl.packet.PacketReceiveEvent;
9
import dev.rise.module.Module;
10
import dev.rise.module.api.ModuleInfo;
11
import dev.rise.module.enums.Category;
12
import dev.rise.setting.impl.BooleanSetting;
13
import net.minecraft.client.gui.GuiChat;
14
import net.minecraft.network.play.server.S2EPacketCloseWindow;
15
16
@ModuleInfo(name = "NoGuiClose", description = "Prevents servers from closing opened Guis", category = Category.OTHER)
17
public final class NoGuiClose extends Module {
18
19
    private final BooleanSetting chatOnly = new BooleanSetting("Chat Only", this, true);
20
21
    @Override
22
    public void onPacketReceive(final PacketReceiveEvent event) {
23
        if (event.getPacket() instanceof S2EPacketCloseWindow && (mc.currentScreen instanceof GuiChat || !chatOnly.isEnabled()))
24
            event.setCancelled(true);
25
    }
26
}

What this file does

The module is the entire technique: a BooleanSetting chatOnly and one onPacketReceive handler that cancels S2EPacketCloseWindow when the screen test passes. The chat-only default restricts the cancel to GuiChat so a server-forced window close cannot interrupt typing; disabling the toggle extends the cancel to every S2E and thereby keeps containers open as well. Because the handler only ever cancels an inbound packet and never sends, the class is the complete wire surface of the module: there is no flush loop, no re-send and no state beyond the toggle. The event is received on the client's packet thread before the vanilla handler runs, so cancelling it prevents func_175159_q from closing the screen, and modifying it would equally change what the vanilla handler applies.

source PacketReceiveEvent.java (cancel carrier)

PacketReceiveEvent.java14 lines · JavaOriginal ↗
1
package dev.rise.event.impl.packet;
2
3
import dev.rise.event.api.Event;
4
import lombok.AllArgsConstructor;
5
import lombok.Getter;
6
import lombok.Setter;
7
import net.minecraft.network.Packet;
8
9
@Getter
10
@Setter
11
@AllArgsConstructor
12
public final class PacketReceiveEvent extends Event {
13
    private Packet packet;
14
}

What this file does

The event object that carries every serverbound-bound packet into the module layer. It holds the raw Packet and the cancelled flag that NoGuiClose flips: EventHandler.handle dispatches it to every enabled module's onPacketReceive, and the fork's receive path checks isCancelled before handing the packet to NetHandlerPlayClient, so a cancelled event never reaches the vanilla S2E handler. The class is trivial (a Packet field plus the inherited cancel state) but it is the exact seam the module exploits: the cancel happens after ProtocolLib-style processing and before vanilla dispatch, which is why the client-side screen survives while the server believes its S2E was delivered.

anticheat Countering Checks

The anticheat code that detects or counters the techniques this module uses. Full source, with the detection mechanism explained below each box.

anticheat intave InventoryTracker (window-state ledger)

InventoryTracker.java190 lines · Java
1
package de.jpx3.intave.module.tracker.player;
2
3
import com.comphenix.protocol.events.PacketContainer;
4
import com.comphenix.protocol.events.PacketEvent;
5
import com.comphenix.protocol.wrappers.EnumWrappers;
6
import com.comphenix.protocol.wrappers.WrappedChatComponent;
7
import de.jpx3.intave.block.collision.Collision;
8
import de.jpx3.intave.block.type.BlockTypeAccess;
9
import de.jpx3.intave.module.Module;
10
import de.jpx3.intave.module.Modules;
11
import de.jpx3.intave.module.linker.packet.ListenerPriority;
12
import de.jpx3.intave.module.linker.packet.PacketId;
13
import de.jpx3.intave.module.linker.packet.PacketSubscription;
14
import de.jpx3.intave.packet.reader.WindowItemReader;
15
import de.jpx3.intave.user.User;
16
import de.jpx3.intave.user.UserRepository;
17
import de.jpx3.intave.user.meta.InventoryMetadata;
18
import de.jpx3.intave.user.meta.MovementMetadata;
19
import org.bukkit.entity.Player;
20
21
import java.util.List;
22
import java.util.stream.Collectors;
23
24
import static de.jpx3.intave.module.linker.packet.PacketId.Client.CLIENT_COMMAND;
25
import static de.jpx3.intave.module.linker.packet.PacketId.Server.*;
26
27
public final class InventoryTracker extends Module {
28
29
  //////////////////////////////////////////////////////////////////////////////
30
  // Open Inventory
31
  //////////////////////////////////////////////////////////////////////////////
32
33
  /**
34
   * Tracks if the server forces a player to open an inventory by listening to
35
   * the {@link de.jpx3.intave.module.linker.packet.PacketId.Server#OPEN_WINDOW}
36
   * packet.
37
   */
38
  @PacketSubscription(
39
    priority = ListenerPriority.HIGH,
40
    packetsOut = {
41
      OPEN_WINDOW
42
    },
43
    ignoreCancelled = false
44
  )
45
  public void sentOpenInventory(PacketEvent event) {
46
    Player player = event.getPlayer();
47
    User user = UserRepository.userOf(player);
48
    InventoryMetadata inventoryData = user.meta().inventory();
49
    PacketContainer packet = event.getPacket();
50
51
    // For some reason the client doesn't send a close window packet after closing
52
    // the beacon window. Therefore, we pretend the player does not have an open
53
    // inventory if he opens the beacon window to avoid further issues.
54
    WrappedChatComponent chatComponent = packet.getChatComponents().read(0);
55
    String json = chatComponent.getJson();
56
    boolean clientDoesNotSendCloseWindow = json.contains("container.beacon");
57
58
    if (!clientDoesNotSendCloseWindow) {
59
      Modules.feedback()
60
        .synchronize(player, null, (p, x) -> openInventory(p));
61
      inventoryData.forceInventoryOnClickOpen = true;
62
    } else {
63
      inventoryData.forceInventoryOnClickOpen = false;
64
    }
65
  }
66
67
  /**
68
   * Tracks if the client opens the inventory by listening to the
69
   * {@link de.jpx3.intave.module.linker.packet.PacketId.Client#CLIENT_COMMAND}
70
   * packet.
71
   * However, this functionality was removed in Minecraft 1.9.
72
   */
73
  @PacketSubscription(
74
    priority = ListenerPriority.LOW,
75
    packetsIn = {
76
      CLIENT_COMMAND
77
    }
78
  )
79
  public void receiveClientCommand(PacketEvent event) {
80
    Player player = event.getPlayer();
81
    EnumWrappers.ClientCommand clientCommand = event.getPacket().getClientCommands().read(0);
82
    if (clientCommand == EnumWrappers.ClientCommand.OPEN_INVENTORY_ACHIEVEMENT) {
83
      openInventory(player);
84
    }
85
  }
86
87
  /**
88
   * Updates the inventory's state of the specified player internally.
89
   *
90
   * @param player The player
91
   */
92
  private void openInventory(Player player) {
93
    User user = UserRepository.userOf(player);
94
    InventoryMetadata inventoryData = user.meta().inventory();
95
96
    if (!inNetherPortal(user)) {
97
      inventoryData.updateInventoryOpenState(true);
98
    }
99
  }
100
101
  /**
102
   * Checks whether the specified user is inside a nether portal.
103
   *
104
   * @param user The user
105
   * @return whether the user is inside a nether portal
106
   */
107
  private boolean inNetherPortal(User user) {
108
    MovementMetadata movementData = user.meta().movement();
109
    return Collision.rasterizedTypeSearch(user, movementData.boundingBox(), BlockTypeAccess.NETHER_PORTAL);
110
  }
111
112
  //////////////////////////////////////////////////////////////////////////////
113
  // Close Inventory
114
  //////////////////////////////////////////////////////////////////////////////
115
116
  /**
117
   * Tracks if the server forces a player to close the inventory by listening to
118
   * the {@link de.jpx3.intave.module.linker.packet.PacketId.Server#CLOSE_WINDOW}
119
   * packet.
120
   */
121
  @PacketSubscription(
122
    priority = ListenerPriority.HIGH,
123
    packetsOut = {
124
      PacketId.Server.CLOSE_WINDOW
125
    },
126
    ignoreCancelled = false
127
  )
128
  public void sentCloseInventory(PacketEvent event) {
129
    Player player = event.getPlayer();
130
    Modules.feedback()
131
      .synchronize(player, null, (p, x) -> closeInventory(p));
132
  }
133
134
  /**
135
   * Tracks if the player closes the inventory by listening to the
136
   * {@link de.jpx3.intave.module.linker.packet.PacketId.Client#CLOSE_WINDOW}
137
   * packet.
138
   */
139
  @PacketSubscription(
140
    priority = ListenerPriority.LOW,
141
    packetsIn = {
142
      PacketId.Client.CLOSE_WINDOW
143
    }
144
  )
145
  public void receiveCloseWindow(PacketEvent event) {
146
    closeInventory(event.getPlayer());
147
  }
148
149
  /**
150
   * Updates the inventory's state of the specified internally.
151
   *
152
   * @param player The player
153
   */
154
  private void closeInventory(Player player) {
155
    User user = UserRepository.userOf(player);
156
    InventoryMetadata inventoryData = user.meta().inventory();
157
    inventoryData.updateInventoryOpenState(false);
158
  }
159
160
  /**
161
   * Closes a player's inventory if the player dies internally by listening to
162
   * Bukkit's {@link org.bukkit.event.player.PlayerRespawnEvent}.
163
   */
164
  @PacketSubscription(
165
    priority = ListenerPriority.HIGH,
166
    packetsOut = {
167
      RESPAWN
168
    },
169
    ignoreCancelled = false
170
  )
171
  public void sentRespawn(PacketEvent event) {
172
    Player player = event.getPlayer();
173
    User user = UserRepository.userOf(player);
174
    InventoryMetadata inventoryData = user.meta().inventory();
175
    inventoryData.updateInventoryOpenState(false);
176
  }
177
178
  @PacketSubscription(
179
    packetsOut = {WINDOW_ITEMS}
180
  )
181
  public void on(
182
    User user, WindowItemReader reader
183
  ) {
184
    if (reader.windowId() == 0) {
185
      List<String> collect = reader.itemMap().values().stream().map(itemStack -> itemStack.getType().name()).collect(Collectors.toList());
186
      user.tickFeedback(() -> user.meta().inventory().setItems(collect));
187
//      System.out.println(collect);
188
    }
189
  }
190
}

How it counteracts this module

InventoryTracker maintains the server's belief about which players have a window open: the outbound S2E (CLOSE_WINDOW) handler closes the state, the inbound C0D handler closes it again, the C16 OPEN_INVENTORY_ACHIEVEMENT command opens it, and S2F WINDOW_ITEMS for window 0 refreshes the item list, with a beacon-window exception because the vanilla client never closes beacons. Because the tracker keys on its own outbound S2E send, NoGuiClose's client-side cancel does not stop the ledger from marking the window closed. With Chat Only off the client then keeps clicking a container that intave considers closed, and every C0E click against that closed-window state feeds the inventory-analysis heuristics (the ChestStealer-style violations the intave command surface prints). With the default Chat Only mode the ledger is never involved: chat has no window id, so open and close events simply do not occur and the tracker records nothing.

anticheat azure InvTweaksA (close-window while sprinting)

InvTweaksA.java23 lines · Java
1
package us.skidrevenant.azure.check.checks.misc.invtweaks;
2
3
import net.minecraft.server.v1_8_R3.Packet;
4
import net.minecraft.server.v1_8_R3.PacketPlayInCloseWindow;
5
import us.skidrevenant.azure.check.Check;
6
import us.skidrevenant.azure.stats.PlayerStats;
7
8
/**
9
 * @author SkidRevenant
10
 * at 03/06/2018
11
 */
12
public class InvTweaksA extends Check {
13
    public InvTweaksA(PlayerStats player) {
14
        super(player);
15
    }
16
17
    @Override
18
    public void onPacketReceiving(Class<? extends Packet> type, Packet packet) {
19
        if (type == PacketPlayInCloseWindow.class && player.getBukkitPlayer().isSprinting()) {
20
            onViolation("InvTweaks Type A", 60000L, 0);
21
        }
22
    }
23
}

How it counteracts this module

The only packet-level C0D consumer in the corpus: onPacketReceiving flags when PacketPlayInCloseWindow arrives while the Bukkit player is sprinting, a signature of inventory-tweak clients that close windows while moving. NoGuiClose never emits C0D itself, and the C0D that the player's own screen-close produces is timed by the player, not the module, so this check sees the same traffic with the module on or off. It is therefore an honest boundary rather than a counter: it targets the opposite abuse (closing windows to sprint-teleport) and is structurally blind to a module whose only action is suppressing an inbound S2E.

anticheat FlopAC InventoryC (click cadence)

InventoryC.java86 lines · Java
1
package me.jtx.flopac.checks.misc.inventory;
2
3
import me.jtx.flopac.base.check.api.Check;
4
import me.jtx.flopac.base.check.api.CheckInformation;
5
import me.jtx.flopac.base.event.PacketEvent;
6
import me.jtx.flopac.base.user.User;
7
import me.jtx.flopac.tinyprotocol.api.Packet;
8
import me.jtx.flopac.tinyprotocol.packet.in.WrappedInWindowClickPacket;
9
import me.jtx.flopac.util.MathUtil;
10
import me.jtx.flopac.util.TimeUtils;
11
12
import java.util.ArrayList;
13
import java.util.List;
14
15
@CheckInformation(checkName = "Inventory", checkType = "C", lagBack = false, punishmentVL = 9)
16
public class InventoryC extends Check {
17
18
    private int shiftClickTicks;
19
    private Long lastClickWindow;
20
    private List<Long> delays = new ArrayList<>();
21
    private double lastStd, threshold;
22
23
    @Override
24
    public void onPacket(PacketEvent event) {
25
        switch (event.getType()) {
26
            case Packet.Client.WINDOW_CLICK: {
27
                User user = event.getUser();
28
29
                WrappedInWindowClickPacket clickPacket = new WrappedInWindowClickPacket(event.getPacket(), user.getPlayer());
30
31
                if (user.shouldCancel() || user.getTick() < 60 || !user.isChunkLoaded()) {
32
                    return;
33
                }
34
35
                if (clickPacket.getAction().isShiftClick()) {
36
                    shiftClickTicks++;
37
                }
38
39
                if (clickPacket.getAction() == WrappedInWindowClickPacket.ClickType.DRAG || shiftClickTicks > 1) {
40
                    return;
41
                }
42
43
                if (clickPacket.getAction().isLeftClick() || clickPacket.getAction().isShiftClick()) {
44
                    long time = System.currentTimeMillis();
45
46
                    if (lastClickWindow != null) {
47
                        long change = TimeUtils.elapsed((time - lastClickWindow));
48
49
                        delays.add(change);
50
51
                        if (delays.size() == 5) {
52
                            double std = MathUtil.getStandardDeviation(delays);
53
54
                            double changeStd = Math.abs(std - lastStd);
55
56
57
                            if (changeStd < 0.7) {
58
                                if (++threshold > 2) {
59
                                    flag(user, "Possibily using ChestStealer or Refill");
60
                                }
61
                            } else {
62
                                threshold -= Math.min(threshold, 0.5);
63
                            }
64
65
                            delays.clear();
66
67
                            lastStd = std;
68
                        }
69
                    }
70
71
                    lastClickWindow = time;
72
                }
73
74
                break;
75
            }
76
77
            case Packet.Client.FLYING:
78
            case Packet.Client.LOOK:
79
            case Packet.Client.POSITION_LOOK:
80
            case Packet.Client.POSITION: {
81
                shiftClickTicks = 0;
82
                break;
83
            }
84
        }
85
    }
86
}

How it counteracts this module

InventoryC scores the standard deviation of five consecutive left or shift C0E click delays, flags when the std-dev delta stays under 0.7 across batches, and prints a chest-stealer or refill suspicion at punishmentVL 9. It only ever sees C0E traffic, so it bites exclusively in the Chat Only off case, where the module keeps a container usable past the server's close and a player can farm it with regular-interval clicks. A default-mode NoGuiClose emits no C0E at all and is invisible to the check. The check is also a window-state dependent: a server that rejects clicks on its closed window produces no click events for it to score, so the realistic surface is servers that process late clicks and let the cadence accumulate.

← Back to Analysis Hub