diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java index 45c259d8d..3d436980d 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java @@ -143,9 +143,14 @@ public class VelocityCommandManager implements CommandManager { @Override public void unregister(final String alias) { Preconditions.checkNotNull(alias, "alias"); - // The literals of secondary aliases will preserve the children of - // the removed literal in the graph. - dispatcher.getRoot().removeChildByName(alias.toLowerCase(Locale.ENGLISH)); + lock.writeLock().lock(); + try { + // The literals of secondary aliases will preserve the children of + // the removed literal in the graph. + dispatcher.getRoot().removeChildByName(alias.toLowerCase(Locale.ENGLISH)); + } finally { + lock.writeLock().unlock(); + } } /**