Libs Disguises

repository·master·Indexed 43 days ago

https://github.com/libraryaddict/libsdisguises

A Minecraft plugin for version 1.12 or newer that allows entities to take on the appearance of other entities or items. It provides an API for programmatic disguise modification and supports command-based usage, including animation triggers via /disguise animate and entity selectors for version 1.13 or newer. Available as a free version with restrictions for non-operators and a premium version with expanded player command access.

Tokens
10.7K
Snippets
28
Records
47
Agent score
55%

What's inside Libs Disguises

  1. Install Libs Disguises via Gradle

    master

    To include Libs Disguises in your Gradle project, add the https://mvn.lib.co.nz/public repository to your repositories block and add the libsdisguises dependency to your dependencies block. Note that this plugin requires Minecraft version 1.12 or newer.

    repositories {
        maven {
            url "https://mvn.lib.co.nz/public"
        }
    }
    
    dependencies {
        implementation group: 'me.libraryaddict.disguises', name: 'libsdisguises', version: '11.0.13'
    }
  2. Install Libs Disguises via Maven

    master

    To include Libs Disguises in your Maven project, add the libsdisguises-public repository to your pom.xml and add the libsdisguises dependency with provided scope. Note that this plugin requires Minecraft version 1.12 or newer.

    <repository>
        <id>libsdisguises-public</id>
        <url>https://mvn.lib.co.nz/public/</url>
    </repository>
    
    <dependency>
        <groupId>me.libraryaddict.disguises</groupId>
        <artifactId>libsdisguises</artifactId>
        <version>11.0.13</version>
        <scope>provided</scope>
    </dependency>
  3. Use the entity selector command to apply disguises

    master

    The entity selector command allows you to apply a disguise to multiple entities at once using Bukkit entity selectors (e.g., @a, @e[type=zombie]).

    Requirements:

    • Minecraft Version: Requires version 1.13 or newer.
    • Plugin Version: This feature is exclusive to the Premium version of Lib's Disguises.
    • Permissions: You must have the appropriate permissions assigned to your user/group to use the command.

    Usage Pattern: [command] <selector> <disguise_details> [options]

    • <selector>: A standard Bukkit entity selector (e.g., @p, @e, @a).
    • <disguise_details>: The configuration for the disguise you wish to apply (parsed via the DisguiseParser).
    • [options]: Specific flags such as setSelfDisguiseVisible can be used to modify how the entity perceives its own disguise.
  4. Animate disguises using entity selectors

    master

    The entity selector animation command allows you to play specific animations on disguises for a group of entities selected via Minecraft entity selectors (e.g., @a, @e[type=zombie]).

    Requirements:

    • Minecraft Version: Requires version 1.13 or newer.
    • License: This feature is exclusive to Premium versions of Lib's Disguises.

    Usage Pattern: To use this command, you must provide an entity selector followed by one or more animation names. The command will attempt to find all entities matching the selector and, for each entity, play the specified animations on any active disguises that support them.

    Command Structure: [command] <selector> <animation1> <animation2> ...

    Note: The exact command name is not explicitly defined in this class but is part of the animate command group. The command logic expects the selector as the first argument after the base command.

    # Example usage (conceptual):
    /disguise animate @a dance
    /disguise animate @e[type=cow] eat
  5. Use the disguise help command

    master

    The disguise help command provides documentation for available disguises, parameters, and their specific options. The command behavior changes based on the arguments provided:

    • No arguments: Displays general usage information and a list of all available parameters.
    • Parameter name (e.g., disguise help <parameter>): Displays help for a specific parameter, including its description and valid enum values if applicable.
    • Disguise name (e.g., disguise help <disguise>): Displays the available options/methods for that specific disguise.
    • Detailed disguise help (e.g., disguise help <disguise> show): Displays all available options for a disguise, including those the user might not have permission to use (noted as ignored options).

    Note: Parameter names in help commands are case-insensitive and can be used in singular or plural forms (e.g., help <param> or help <params>).

    ### Examples
    
    # Get general help and parameter list
    /disguise help
    
    # Get help for a specific parameter
    /disguise help <parameter_name>
    
    # Get help for a specific disguise
    /disguise help <disguise_name>
    
    # Get exhaustive help for a disguise (including hidden/restricted options)
    /disguise help <disguise_name> show
  6. Use the /disguise command to apply a disguise

    master

    The /disguise command allows players to change their appearance using various disguise types. The command parses the provided arguments to determine the disguise type and its specific properties.

    Usage

    To use the command, provide the disguise type and any necessary parameters as arguments. The command is processed by DisguiseParser based on the permissions the sender possesses.

    Key Features

    • Dynamic Name Display: If configured in DisguiseConfig, the player's name can be hidden or shown above the disguise. If isNameOfPlayerShownAboveDisguise is true and the player has the libsdisguises.hidename permission, the name is managed via the LivingWatcher.
    • Self-Disguise Visibility: You can control whether you can see your own disguise using the setSelfDisguiseVisible argument.
    • Automatic Expiry: On certain hosted environments (like BisectHosting), disguises may have a default expiry time (e.g., 10 minutes) unless configured otherwise in DisguiseConfig.

    Requirements

    • The command must be executed by an Entity (typically a player); it cannot be run from the console.
    • Users must have the appropriate permissions to access specific disguise types.
    # Example usage (exact syntax depends on the disguise type being parsed)
    /disguise <disguise_type> [options]
  7. View available disguise types and help

    master

    If you run the /disguise command without any arguments, the plugin will display usage information and a list of disguise types you are permitted to use.

    Help Output

    • Permission Check: If you have no allowed disguises, you will receive a NO_PERM message.
    • Disguise List: The plugin lists all allowedDisguises based on your DisguisePermissions.
    • Contextual Help:
      • If player is an allowed disguise, additional help instructions (DISG_HELP2) are shown.
      • If dropped_item or falling_block are allowed, additional help instructions (DISG_HELP4) are shown.
  8. Troubleshoot Libs Disguises issues

    master

    When reporting issues or troubleshooting, follow these steps:

    1. Check Dependencies: Ensure you are using the appropriate version of PacketEvents.
    2. Verify Loading: Check your server logs to ensure there were no error messages while Lib's Disguises was loading.
    3. Update Development Builds: If using development builds, ensure you are on the latest version before reporting a bug.
    4. Provide Detailed Reports: When posting an issue, include:
      • A full stack trace error (or a description of the odd behavior if no stack trace exists).
      • The exact steps required to reproduce the issue.
      • Comprehensive information regarding what the issue is and why it occurred.
  9. Reference: LibsDisguises CLI Subcommands

    master

    The following subcommands are available via the /libsdisguises command. Note that availability and tab-completion may vary based on your permissions.

    LDHelp
    LDReload
    LDUpdate
    LDChangelog
    LDCount
    LDConfig
    LDPermTest
    LDScoreboard
    LDJson
    LDMods
    LDMetaInfo
    LDDebugPlayer
    LDUploadLogs
    LDUpdatePacketEvents
    LDDebugMineSkin
    LDDebugDisguiseLoop
    LDMissingDescription
    LDDebugging
  10. Disguise help command tab completion

    master

    The disguise help command supports tab completion to assist in discovering available commands and parameters:

    1. First argument: Completes to available disguise types (formatted with underscores, e.g., cow_disguise) and available parameter names.
    2. Subsequent arguments: If the first argument is not a valid disguise, it suggests the show keyword to help with detailed option lookups.
  11. Disguise entity command requirements and limitations

    master

    The disguise entity command has several constraints:

    • Player Only: This command cannot be executed from the console; it requires a Player sender.
    • Permissions: The sender must have the appropriate permissions defined by the plugin's permission system.
    • Premium Feature: Some users may be restricted from using this command if they do not have a premium version (checked via sendIfNotPremium).
    • Rate Limiting: The command is subject to a hit rate limit to prevent abuse.
    • Disguise Types: Available disguise types depend on the player's permissions. Common types mentioned in usage help include player, dropped_item, and falling_block.