1.15.2 Giving permissions not shows suggestions

Discussion in 'Spigot Plugin Development' started by marco.paggioro, Apr 3, 2020.

Thread Status:
Not open for further replies.
  1. Hi,
    I'm following this guide to implement a permission group for VIPs. So in the plugin.yml there is the command:

    Code (YAML):
    . . .
    permissions
    :
      areson.survival.vip
    :
        description
    : "Permissions VIP"
    . . .
    commands
    :
    homes
    :
        usage
    : "/<command>"
        permission
    : areson.survival.vip
    . . .
    I implemented the HashMap that store permissions:

    Code (Java):
    . . .
    private HashMap<String, PermissionAttachment> playersAttachments;
    . . .
    And in a PlayerJoinEvent:

    Code (Java):
    . . .
            PermissionAttachment permissionAttachment = player.addAttachment(pluginInstance);
            if (playerName.equals("RandomUserName")) {
                permissionAttachment.setPermission("areson.survival.vip", true);
            }
            pluginInstance.addPlayerAttachment(playerName, permissionAttachment);
    . . .

    All works. If I have not the permission I can't do the command and If I have the permission I can do it. The only issue is that spigot chat do not autocomplete the command anymore. Before that implementation if I had written /hom and pressed Tab the chat would auto-complete with /homes. Now It not autocomplete. But the command works.

    Any ideas?
     

    Attached Files:

  2. SOLVED!
    I added:
    Code (Java):
    player.updateCommands();
    After i give the permissions
     
Thread Status:
Not open for further replies.