crwdns145647:0crwdne145647:0

Note

crwdns145649:0crwdne145649:0

crwdns145651:0crwdne145651:0

  1. crwdns145653:0crwdne145653:0

    crwdns145655:0crwdne145655:0

  2. crwdns145657:0crwdne145657:0

    crwdns145659:0crwdne145659:0

Tip

crwdns145661:0:doc:crwdnd145661:0:doc:crwdnd145661:0:doc:crwdne145661:0

crwdns145663:0crwdne145663:0

crwdns145665:0crwdne145665:0

Note

crwdns145667:0crwdne145667:0

crwdns145669:0crwdne145669:0

private boolean registered = false;

@Listener
public void onInit(GameInitializationEvent event) {
    Sponge.getCommandManager().register(this,
        CommandSpec.builder().executor((source, context) -> {
            if (this.registered) {
                this.registered = false;
                Sponge.getEventManager().unregisterListeners(this.listener);
            } else {
                this.registered = true;
                Sponge.getEventManager().registerListeners(this, this.listener);
            }
            return CommandResult.success();
        }).build(), "flowerPotTest");
}

Note

crwdns145671:0crwdne145671:0