Config.yml - Arnuh/EchoPet GitHub Wiki


The config.yml is the main Configuration File for the EchoPet plugin, containing many useful features that can be enabled and disabled. If any values are lost from the file, they will automatically regenerate the next time the server restarts or reloads, meaning that if the file is cleared, a default config.yml will generate. Comments will also reappear if lost.

The following table can be used as a guide to configuring the config.yml, generated in the /plugins/EchoPet directory.

Configuration Option Default Function And Explanation
commandString pet The string used when registering the plugin’s main command. If it is set to ec, the main command will be /ec.
checkForUpdates true Boolean value. Activates or deactivates the Update Checker. Players with the echopet.update permission will be notified of updates if set to true.
sql.use false Whether or not to utilise MySQL
sql.host localhost Database Host
sql.port 3306 Database Port
sql.database echopet Database Name
sql.username root Database Authentication
sql.password '' Database Authentication
petNames.key allow List of Pet Names which are 'deny' or 'allow'.
petNamesRegexMatching true Enable regex matching for entries under petNamesRegex
stripDiacriticsFromNames true Strip diacritics from pet names
loadSavedPets true Auto-load pets from last session
multiworldLoadOverride true When true, if loadSavedPets is set to false, Pets will still be loaded when players switch worlds
sendLoadMessage true If autoLoadSavedPets is true, send a message that a Pet was loaded
sendForceMessage true If a data value is forced by configuration (see below), a message will be sent to the player notifying them of forced data.

SQL

Starting with EchoPet v1.2, HikariCP is now being used. I highly recommend to read the HikariCP Wiki if you plan to use SQL for EchoPet.

EchoPet by default sets rewriteBatchedStatements, cachePrepStmts, useServerPrepStmts to true. All three should have no downsides and are compatible with modern SQL server versions.

To configure HikariCP or to override the default configuration options, you can create a hikaricp.properties file in EchoPets plugin configuration folder. An example propertiles file is provided here. You can then research the HikariCP Configuration Options for all options and explanations.

Pet Selector

Configure Pet Selector menu.

  • Give On Join
    • Enable (petSelector.giveOnJoin.enable)
      • Players will be given the PetSelector item upon joining the server.
    • Use Perm (petSelector.giveOnJoin.usePerm)
      • Players will be check for the permission set below before being given the Pet Selector item.
    • Permission (petSelector.giveOnJoin.perm)
      • The permission to be used if petSelector.giveOnJoin.usePerm is set to true.
    • Slot (petSelector.giveOnJoin.slot)
      • The inventory slot that the Pet Selector will be placed in. 8 is the last slot on the hotbar.
  • Clear Inventory On Join (petSelector.clearInvOnJoin)
    • On joining, each player's inventory will be cleared.
  • Allow Drop (petSelector.allowDrop)
    • Allow dropping the Pet Selector item.
  • Show Disabled Pets (petSelector.showDisabledPets)
    • Show disabled pets in the menu.
  • Item
    • Name (petSelector.item.name)
      • The name of the item.
    • Lore (petSelector.item.lore)
      • The lore of the item.
    • Material (petselector.item.material)
      • The material of the item.
  • Menu
    • Pages (petSelector.menu.pages)
      • Total page count for the menu.
    • Title (petSelector.menu.title)
      • Menu title.
    • Page # (petSelector.menu.page-#)
      • Page #
        • List of items for this page separated by slot.
        • Example for slot 0(Pet) and slot 50(Only Command)
      page-0:
          '0':
            command: pet axolotl
            petType: AXOLOTL
            material: AXOLOTL_SPAWN_EGG
            entityName: axolotl
            name: Axolotl Pet
            lore: []
          '50':
            command: pet ride
            petType: ''
            material: CARROT_ON_A_STICK
            name: '&eRide Pet'
            lore: []
      

Pets Section

Each Pet has multiple configurable options specific to each type. There are three values that are common to all Pet Types:

  • Enable (pets.<type>.enable)
    • Able to block specific Pet Types server-side
  • Tag Visible (pets.<type>.tagVisible)
    • Defines if the Pet's name tag is permanently visible or only on roll-over
  • Default Pet Name (pets.<type>.defaultName)
    • The name every Pet is given when spawned without one

    • If this value contains (user), the owner's name will be inserted

      • For example, if the owner's name was DSH105:

      The Pet of (user)

      would show as:

      The Pet of DSH105

    • If this value contains (userApos), the owner's name will be inserted, along with an apostrophe

      • For example, if the owner's name was DSH105:

      (userApos) Pet

      would show as:

      DSH105's Pet

  • Open DataMenu on Interact (pets.<type>.interactMenu)
    • Defines if the Pet's DataMenu opens when the owner interacts with it
  • Pet Riders (pets.<type>.riders)
    • Determine if the pet allows other pets to be riders.

Pet Riding Values

  • Values under pet.<type>.riding determine properties for riding of each Pet.
    • Ignore Fall Damage Whilst Ridden (pets.<type>.riding.ignoreFallDamage)
      • Determines if the owner will take fall damage when riding its pet.
    • Speed Whilst Ridden (pets.<type>.riding.walkSpeed)
      • The speed at which a Pet travels when ridden by its owner.
    • Speed Whilst Ridden (pets.<type>.riding.flySpeed)
      • The speed at which a Pet travels when flying.
    • Jump Height Whilst Ridden (pets.<type>.riding.jumpHeight)
      • The height a Pet can jump when ridden by its owner
    • Ability To Fly (pets.<type>.riding.canFly)
      • Defines if the Pet has the ability to fly when ridden by its owner.
    • Gravity (pets.<type>.riding.gravity)
      • Modify the gravity of a pet you are riding & flying
      • Modifier of 0 will make the pet float.
      • Modifier of 1 will give normal gravity.
      • Modifier of 0.5 will make the pet fall 50% slower.

Pet Data Values

  • Values under pet.<type>.data determine properties for the valid Pet Data of each Pet.
    • Allow (pet.<type>.data.<datatype>.allow)
      • If the pet data is allowed for the pet.
    • Force (pet.<type>.data.<datatype>.force)
      • If the pet data is forcefully enabled when the pet is spawned.
    • Default (pet.<type>.data.<datatype>.default)
      • Determines the default value of the pet data. The default is used when the player doesn't specify the value during spawn.
      • Enabling force will use the default as the user can't specify a value.
  • Example, the following configuration would disable being able to ride the Iron Golem pet while also force enabling its health with a default of half the max to show "Cracking".
irongolem:
  data:
    ride:
      default: true
      allow: false
      force: false
    health:
      allow: true
      force: true
      default: 50.0

Pet Goal Values

  • Values under pet.<type>.goal determine properties for the goals of each Pet.
    • Speed While Walking (pets.<type>.goal.walkSpeed)
      • The speed at which a Pet travels when walking.
    • Speed While Flying (pets.<type>.goal.flySpeed)
      • The speed at which a Pet travels when flying.
    • Follow (pets.<type>.goal.follow`)
      • Start Follow Distance (pets.<type>.goal.startDistance`)
        • Range away from the owner before the Pet starts following
      • Stop Follow Distance (pets.<type>.goal.stopDistance`)
        • Range away from the owner before the Pet stops following
      • Teleport Distance (pets.<type>.goal.teleportDistance`)
        • Range away from the owner before the Pet teleports
      • Speed Modifier (pets.<type>.goal.speedModifier`)
        • Modifier of the current walk or fly speed when following.

Pet Brain Values

The brain for a monster is a more complex set of Pet Goals. Currently Brain support for pets is in early testing and shouldn't be used.

Worlds Section

This Configuration Section allows server owners to block and allow Pets in certain worlds. Worlds need to be added manually.

The following example allows Pets in the world and world_nether worlds, but not in world_the_end. Note that there is TWO spaces before the world name (not a tab space).

worlds:
  world: true
  world_nether: true
  world_the_end: false
  enableByDefault: true

The enableByDefault option will enable/disable Pets for any worlds not mentioned.

Region Blacklist Section

This Configuration section controls the regions in which Pets are disabled and enabled. When the Config.yml is first generated, an example is produced, similar to the setup below.

In the following example, Pets are disabled in the nopets and minigame WorldGuard regions, and enabled by default in all other regions. Areas with no defined region follow the default setting.

worldguard:
  regions:
    nopets: false
    minigame: false
    allowByDefault: true
  regionEnterCheck: true

The worldguard.regionEnterCheck value controls the PlayerMoveListener for Regions. If set to true, Players entering a region in which Pets are disabled will have their Pet automatically removed. This may be disabled for CPU Usage and Performance reasons.

⚠️ **GitHub.com Fallback** ⚠️