Character Slots / User Profiles 1.1.5

Give users multiple characters/"profile slots", each with separate inventory, perms, etc.

  1. liam_
    Native Minecraft Version:
    1.13
    Tested Minecraft Versions:
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    Demo



    Support: https://discord.gg/cC7Uy6p

    This plugin DOES NOT work with standalone Spigot or Paper instances due to technical reasons. It MUST be a server network backed by Waterfall or Bungeecord with at least TWO Spigot or Paper instances.

    Features
    • Users can create profiles self-serve
    • Server owner can configure the max number of profiles per-group
    • Profiles are essentially separate users -- distinct inventories, permissions, homes. Each profile has a unique uuid, so integration with most plugins is seamless.
    • Placeholder API extension to retrieve the profile uuid and "genuine/mojang" uuid
    • Customizable menu text and icons (see Config example).
    • Execute arbitrary commands (as console) when a profile is created, deleted, or a user switches to a profile. These commands support Placeholder API. (use this to copy permissions/roles from the mojang profile)
    • Modular plugin system with SDK for third-party developers to use the underlying profile switching functionality.
    Network Requirements
    This plugin requires a server network that uses Waterfall with at least two minecraft servers that do not have "restricted" access/whitelist (eg, a hub server and a kitpvp server). The default profile GUI plugin requires a MySQL database. This plugin has only been tested with Waterfall, Spigot, and Paper. BungeeCord should work correctly, but is untested.


    Config

    Code (YAML):

    # This plugin MUST use mysql as it requires cross-server database
    mysql
    :
      connector
    : "jdbc:mysql://127.0.0.1:3306/profilesplugin?user=testuser&password=testpass&autoReconnect=true"

    options
    :
     # the max profile slot limit applies to all groups, including admins/op. There is a hard limit of 15. You can configure different limits for different roles
      defaultProfileSlots
    : 5
      # You can use any permission here. it doesn't have to be anything specific to ProfilesPlugin.
      # For each user, we need to know how many profiles slots the user has. We will check all of these permissions, and limit
      # that user to the number of slots. If a user has multiple of these permissions, we will use the greatest number of
      # slots out of the permissions that match
      profileSlotsByPermission
    :
       # go into your permissions plugin, and run a command like. `/lp group vip permission set role.vip true`
        role.vip
    : 7
        role.vipplus
    : 8
        role.mvp
    : 9
        role.mvpplus
    : 10

    # hooks are commands that are executed as console when a certain event occurs. These commands support placeholder API,
    # and ProfilesPaperGui defines some custom expansion tags:
    # - %playerprofiles_genuineuuid% - this is the user's mojang uuid. This profile is "special" and cannot be deleted. This
    #                                  is sometimes called the "genuine" profile or "mojang" profile
    # - %playerprofiles_profileuuid% - this is a newly created uuid that serves as the profile. If the user is on their genuine
    #                                  profile, then this will evaluate to the same thing as the genuineuuid expansion -- their
    #                                  mojang uuid.
    # - %playerprofiles_deleteduuid% - this only works during the onDeletedProfile hook
    hooks
    :
     # onCreateProfile runs after a user creates a new profile, and they've reconnected to the server with that profile
      # active. Use this hook for first-time profile setup
      onCreateProfile
    :
       - "say User %player_name% has created a new profile: %playerprofiles_profileuuid%"
        - "lp user %playerprofiles_genuineuuid% clone %playerprofiles_profileuuid%"
      # on switch profile runs after a user switches to a profile (runs after the onCreateProfile hook for new profiles).
      # the primary use of this hook is to copy permissions/groups from the main profile to the new one. Do not copy permissions
      # in the create hook because if you change the permissions on the genuine profile, those changes won't be replicated to
      # pre-existing profiles (unless your permissions plugin supports players inheriting from other players. Luckperms does not)
      # onSwitchProfile does *NOT* run when the user switches to the genuine/mojang profile.
      onSwitchProfile
    :
       - "say User %player_name% has switched to profile %playerprofiles_profileuuid%. Their real UUID: %playerprofiles_genuineuuid%"
        - "lp user %playerprofiles_genuineuuid% clone %playerprofiles_profileuuid%"
      # onDeleteProfile runs when the user deletes a profile. The user cannot delete a profile when they have that profile
      # selected, so the deleteduuid and profileuuid are guaranteed to be different.
      onDeleteProfile
    :
       - "say User %player_name% deleted their profile with the uuid %playerprofiles_deleteduuid%"
        - "lp user %playerprofiles_deleteduuid% clear"

    # these strings are configurable and all of them support placeholder api
    # Materials: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
    gui
    :
      profileSelectorMain
    :
        slots
    :
         - "0,0,0,0,0,0,0,X,0"
          - "0,1,1,1,1,1,0,X,S"
          - "0,1,1,1,1,1,0,X,0"
          - "0,1,1,1,1,1,0,X,D"
          - "0,0,0,0,0,0,0,X,0"
        legend
    :
          0
    : NOTHING
          X
    : DIVIDER
          1
    : CHAR_SLOT
          S
    : SELECT_PROFILE
          D
    : DELETE_PROFILE
        text
    :
          windowTitle
    : "Profile Manager"
          slotEmpty
    :
            title
    : "&cEmpty Profile Slot"
            body
    : "&7Click to create"
            material
    : OAK_BUTTON
          slotActive
    :
            title
    : "&6%mmocore_class% &7| &7Level: &e%mmocore_level%"
            body
    : |-
              &fHealth
    : &7%mmocore_max_health%
              &fMana
    : &7%mmocore_mana%
              &fUUID
    : &7%player_uuid%
              &8Current character
            material
    : GRASS_BLOCK
          slotCreated
    :
            title
    : "&6%mmocore_class% &7| &7Level: &e%mmocore_level%"
            body
    : |-
              &fHealth
    : &7%mmocore_max_health%
              &fMana
    : &7%mmocore_mana%
              &fUUID
    : &7%player_uuid%
            material
    : ARMOR_STAND
          slotBlocked
    :
            title
    : "&fUpgrade to unlock this slot"
            body
    : "&7Buy a rank from our website for more character slots! &3WebsiteURL"
            material
    : BARRIER
          slotBlockedFromDeletion
    :
            title
    : "&4This profile cannot be deleted"
            body
    : "&cThis profile uses your genuine mojang uuid and cannot be deleted for technical reasons."
            material
    : BARRIER
          selectButton
    :
            title
    : "Select mode"
            body
    : "When you click on a profile slot in select mode, it will change you to that profile"
            activeMaterial
    : EMERALD_BLOCK
            inactiveMaterial
    : OAK_BUTTON
          deleteButton
    :
            title
    : "&cDelete mode"
            body
    : "&7When you click on a profile slot in delete mode, it will open a confirmation screen to delete that profile"
            activeMaterial
    : EMERALD_BLOCK
            inactiveMaterial
    : OAK_BUTTON
      profileSelectorDeleteConfirm
    :
        slots
    :
         - "0,0,0,0,0,0,0,0,0"
          - "0,0,D,0,0,0,B,0,0"
          - "0,0,0,0,B,0,0,0,0"
        legend
    :
          0
    : NOTHING
          X
    : DIVIDER
          D
    : CONFIRM_DELETE
          B
    : BACK
        text
    :
          windowTitle
    : "&cConfirm Deletion"
          confirmDeleteButton
    :
            title
    : "&cDelete this profile"
            body
    : "&7Are you sure you wish to delete the profile with uuid: %player_uuid%? This operation CANNOT be reversed. Click to confirm"
            material
    : EMERALD_BLOCK
          backButton
    :
            title
    : "&aBack"
            body
    : "&7Do not delete this profile"
            material
    : BARRIER
     

    Installation Instructions
    This resource consists of three separate plugins:
    • ProfilesWaterfall - provides the core "profile switch" functionality as bungee communicaiton channels. Provides the `/setuuid` command for admins
    • ProfilesPaperCore - provides the SDK to interact with ProfilesWaterfall, and is responsible for receiving and dispatching custom events from ProfilesWaterfall (eg,
      PlayerUUIDOverrideEvent).
    • ProfilesPaperGUI - Provides the `/profiles` command. This is the only plugin that connects to MySQL. This plugin consumes the SDK and events from the ProfilesPaperCore plugin. In the future, other options may be available to replace this third plugin.
    The ProfilesWaterfall plugin has no configuration, and can simply be added to Waterfall.

    The ProfilesPaperCore plugin has no configuration, and can simply be added to Paper.

    The ProfilesPaperGUI plugin requires configuration:
    • Set the database connection string in the config
    • If you are using LuckPerms, the default config includes the correct hook commands. It also includes some "say" commands, which you can remove, but the default config works correctly.
    • When a user "switches" profiles, they are essentially connecting with a completely different minecraft account. You need to make sure the permissions from their genuineuuid are copied to their profileuuid

    ProfilesPaperCore and ProfilesPaperGUI must be added to *every* server in the network, as the profiles are network-wide. All these servers should use the exact same MySQL database.

    Not adding these plugins to a specific server will not prevent users from connecting to that server with a profile, as they could switch on a different server.


    Permissions
    profileswaterfall.admin.setuuid -- use of the /setuuid command. This perm check occurs on waterfall, so you need a bungee/waterfall permissions plugin to grant this permission. This permission allows users to spoof as any profile, including as real mojang uuids (including the network admins). So, the users with this permission should be the highest level of admin only.

    profiles.user -- use of the /profiles command. This should be granted to users that are allowed to use the profile system.


    FAQ
    Q: Couldn't you generate a UUID of a user that already exists?

    Yes. But this is exceedingly unlikely to the point where the risk is practically zero. To quote wikipedia: https://en.wikipedia.org/wiki/Universally_unique_identifier

    (and wikipedia's definition is for any two collisions. For collisions with a specific UUID, it's orders of magnitude less likely)

    Q: I don't want users to have profiles on one server in my network. Eg, I want profiles on skyblock but not on skywars.

    This is not currently supported by this resource. Currently, when a user switches to a profile, that profile persists through server switches until that user disconects from bungee. You may be able to work around this, but first-class support would definitely be nice. If enough people ask, we may add it.

    Q: Why are profiles network-wide in the first place? Why not server-specific profiles in the first place?

    It's difficult to predict how server networks will use profiles. Some networks may want network-wide profiles, some may want server specific profiles. From a technical standpoint, the overriding of the uuid occurs in Waterfall, and Waterfall would need to keep track of which UUIDs are for which servers, and trigger a uuid switch when an invalid scenario is detected. We took the approach that the Waterfall plugin is stateless, and simply provides the switching functionality, and leaves the logic to downstream Paper plugins. In this sense, network-wide is the "default"/minimal behavior. We can shape the behavior over time to better meet the needs of real servers.

    Q: I am a third-party developer, and I want to develop my own profiles plugin. How do I use the SDK?

    You will need to install the ProfilesWaterfall and ProfilesPaperCore plugins normally. Your project will need to add the ProfilesPaperCore jar as a dependency.

    The ProfilesPaperCore plugin dispatches custom events of the type PlayerUUIDOverrideEvent. You can listen to these like any normal minecraft event:

    Code (Java):
    import com.awooga.profiles.events.PlayerUUIDOverrideEvent;

    @EventHandler
    public void onUUIDOverrideEvent(PlayerUUIDOverrideEvent ev) {}
    We also provide an SDK to interact with Bungee:
    Code (Java):
    import com.awooga.profiles.ProfilesPaperCoreSDK;

    ProfilesPaperCoreSDK sdk = ProfilesPaperCoreSDK.getInstance();
    // currently the SDK has one function:
    sdk.switchPlayerToProfile(Player player, UUID genuineUuid, UUID profileUuid)
    aglerr and Jacobtheflame20 like this.

Recent Reviews

  1. Renauddj
    Renauddj
    5/5,
    Version: 1.0.8
    active, fast and efficient, what more can I say?
    more words more words more words
  2. Mexbotdude
    Mexbotdude
    5/5,
    Version: 1.0.5
    Amazing, I've been looking for a plugin like this for 2 years. If you follow the instructions carefully you can easily install it. Worth to switch over Paper & Waterfall just for this plugin
  3. Jacobtheflame20
    Jacobtheflame20
    5/5,
    Version: 1.0.4
    Amazing plugin once you get it up and running. Easy user interface using the /profiles command and a simple config to understand. If this was a premium resource, I would but it. Keep up the amazing work!
  4. maiyeuca0n31
    maiyeuca0n31
    5/5,
    Version: 1.0.4
    Its a cool plugin, but it doesn't support for spigot. Plz support spigot, thank you