CommandMap map;
Command original = map.get("test");
if(original != null) {
map.put("test", new Command() {
public void command(sender, command, label, args) {
if(args.length == 0) {
//execute registered command
} else {
original.command(sender, command, label, args);
}
}
});
} else {
//Just register regular command
}
If a command is wrapped on unregister it should unwrap.