Skip to content

voidpointer0x00/VillagerRestock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VillagerRestock

Villager restock is an optimized and configurable alternative to Villager Restocking and Infinite Trades datapacks.

The Problem

The Infinite Trades datapack works fine except it just doesn't on MC 1.19.

On the other hand, the Villager Restocking datapack does work on MC 1.19, but it comes with a huge performance overhead — it runs EVERY TICK, so it modifies NBT tags using commands on all villagers in the world causing lag and MSPT growth (1MSPT for a group of 3 villagers on my CPU).

The Solution

That being said, I developed this plugin for my personal use and decided to just simply share it if someone else needs it too.

The plugin is aimed to run on vanilla/semi-vanilla servers to remove annoying restocking cooldown mechanic (RestocksToday), optionally reset demands (the more you buy the higher the price) and clear players reputations.

Installation

Download the right plugin version for you server and install it under the plugins/ in your server working directory.

Commands

  • /vr-reload — reloads the plugin configuration. Requires villagerrestock.reload permission to run.

Configuration

# I'd only use reset-restock property to keep the game close
#   to vanilla behaviour and remove this annoying 10m cooldown
#   between restocks. Though, I still implemented reputations and
#   demands resets just in case someone reckons that it should also
#   be changed on their servers.
settings:
  # Resets villager's RestocksToday NBT tag so that
  #   10m restock cooldown doesn't start.
  reset-restock: true
  # Resets the demand on merchant recipes, so they don't
  #   higher the price anymore. Doesn't affect negative
  #   demands (i.e. Hero of the Village effect).
  reset-demands: false
  reputations:
    # Clears negative reputations.
    #   (prices no longer get higher when you damage/kill villagers)
    clear-negative: false
    # Clears trade reputations.
    #   (disables trading bonuses from upgrading villagers to a certain level)
    clear-trade: false
    # Clears reputation for cured villagers.
    #   (disables trading bonuses from curing zombified villagers using golden apples)
    clear-cure: false
    # NOT YET IMPLEMENTED
    # Disables trading bonuses from Hero of the Village effect.
    #   You may want to enable it if you reckon raid farms are too OP.
    # disable-hero: false

Requirements

  • Java 17
  • Paper 1.19

The plugin works exclusively on Paper and it's forks (if it's compatible), I'm not going to port it to Spigot. Right now it's built only for 1.19MC using Java 17 features, but I'm planning to build it for latest minors of 1.14-1.18 MC versions.

Build

Just mvn package and get the VillagerRestock jar from /target directory.