Go to file
PretzelJohn 8720e840e2 Version 1.5.0-pre4:
* Add per-villager restock cooldowns

To-do:
* Add enchantments, data, etc. to ingredients and result
* Add config editor GUI in-game
2022-01-15 12:10:28 -05:00
src Version 1.5.0-pre4: 2022-01-15 12:10:28 -05:00
.gitignore Version 1.4.0: 2021-12-15 15:30:01 -05:00
pom.xml Version 1.5.0-pre2: 2022-01-11 04:22:52 -05:00
README.md * Update readme to document new features 2022-01-11 04:53:06 -05:00

VillagerTradeLimiter (VTL)

by PretzelJohn

Description:

This Minecraft plugin limits the villager trade deals that players can get.

Click here to see this plugin on Spigot.


Commands:

Command Alias Description
/villagertradelimiter /vtl Shows a help message
/villagertradelimiter reload /vtl reload Reloads config.yml
/villagertradelimiter see <player> /vtl see <player> Shows the trades for another player.
To use, look at the villager you want
to see the trades for.
/villagertradelimiter invsee /vtl invsee Shows the inventory of a villager.
To use, look at the villager you want
to see the trades for.

Permissions:

Permission Description Default User(s)
villagertradelimiter.* Allows players to use ALL commands OP
villagertradelimiter.use Allows players to use /vtl OP
villagertradelimiter.reload Allows players to reload config.yml and messages.yml OP
villagertradelimiter.see Allows players to see the trades for another player
with /vtl see <player>
OP
villagertradelimiter.invsee Allows players to see inventory of a villager
with /vtl invsee
OP

Config:

  • Global settings: These settings apply to all villagers and villager trades.

    Setting Description
    bStats: This helps me keep track of what server versions are being used. Please leave this set to true.
    database.mysql: Whether to use MySQL for the database (true) or SQLite (false)
    database.host: The IP address or domain name of your MySQL server. If the MySQL database is on the same server as your Minecraft server, leave this as 127.0.0.1
    database.port: The port number of your MySQL server. Usually 3306.
    database.database: The name of your MySQL database, or schema. You must create a database (schema) before using this plugin!
    database.username: The username to access your MySQL database.
    database.password: The password to access your MySQL database.
    database.encoding: If your MySQL database uses an encoding other than utf8, change this.
    database.useSSL: If your MySQL database can use SSL connections, set this to true!
    DisableTrading: Whether to disable all villager trading for all worlds, some worlds, or no worlds.
    Options:
    • Add world names for worlds that you want to completely disable ALL villager trading.
    • Set to true to disable trading in all worlds.
    • Set to false or [] to disable this feature.
    MaxHeroLevel: The maximum level of the "Hero of the Village" (HotV) effect that a player can have. This limits HotV price decreases.
    Options:
    • Set to -1 to disable this feature and keep vanilla behavior
    • Set to a number between 0 and 5 to set the maximum HotV effect level players can have
    MaxDiscount: The maximum discount (%) you can get from trading/healing zombie villagers. This limits reputation-based price decreases.
    Options:
    • Set to -1.0 to disable this feature and keep vanilla behavior
    • Set to a number between 0.0 and 1.0 to limit the maximum discount a player can get. (NOTE: 30% = 0.3)
    • Set to a number above 1.0 to increase the maximum discount a player can get. (NOTE: 250% = 2.5)
    MaxDemand: The maximum demand for all items. This limits demand-based price increases.
    Options:
    • Set to -1 to disable this feature and keep vanilla behavior
    • Set to 0 or higher to set the maximum demand for all items

    WARNING: The previous demand information cannot be recovered if it was higher than the MaxDemand.
    MaxUses: The maximum number of times a player can make any trade before a villager is out of stock.
    Options:
    • Set to -1 to disable this feature and keep vanilla behavior
    • Set to 0 or higher to change the maximum number of uses for all items
  • Per-item settings: (Overrides:)

    Setting Description
    <item_name>: Override the global settings by adding as many of these as you need. Enchanted books must follow the format of name_level (mending_1). All other items must follow the format of item_name (stone_bricks).
    .Disabled: Disables any trade that contains the item (true/false)
    .MaxDiscount: Sets the maximum discount for this item (-1.0, or between 0.0 to 1.0)
    .MaxDemand: Sets the maximum demand for this item (-1, or 0+)
    .MaxUses: Sets the maximum number of times a player can make the trade before the villager is out of stock
    .Cooldown: Sets the time between restocks for the trade, and applies to ALL villagers. Once the player reaches the MaxUses, the cooldown begins. The trade is disabled for all villagers until the cooldown expires.
    FORMAT: <Number><interval>
    EXAMPLE: 30s = 30 seconds, 5m = 5 minutes, 4h = 4 hours, 7d = 7 days
    .Item1.Material:
    .Item2.Material:
    .Result.Material:
    Sets the material of the 1st or 2nd item in the trade
    WARNING: This cannot be undone!
    .Item1.Amount:
    .Item2.Amount:
    .Result.Amount:
    Sets the amount of the 1st or 2nd item in the trade
    WARNING: This cannot be undone!
  • For the default config.yml, see: src/main/resources/config.yml