Code Monkey home page Code Monkey logo

antivillagerlag's Introduction

AntiVillagerLag

SpigotMC: Link

This is a simple plugin that allows your players to optimize their own villagers and does not effect anything vanilla wise. I am making this plugin due to massive trading halls tanking mspt on my servers and others. This will allow trading halls to keep their twice a day villager restocks but won't affect any farms villagers will be used in, such as Iron Golem Farms, Villager Breeders, Raid Farms, Etc.

How the plugin works

You name a villager with a nametag that matches the name set in config.yml under "NameThatDisables:" and disables the villagers ai. If you wish to re-enable the villager ai all you have to do is rename it to anything else. In addition or instead of you can use a block a villager stands on to enable/disable villager ai (after interaction with the villager), you can set "BlockThatDisables:" to the block you want and change "useblocks:" to true. Disabled villagers get restocked at two configurable times of day, when the player right clicks the villager. During this right click it checks the custom time stored on the villager of when it was last restocked compared to the current server time. The plugin checks if villagers are ready to Levelup and re-enables their ai for 5 seconds to let them levelup their trades.

Please Note

While the villagers are optimized they will not sleep in beds, or breed while ai is disabled. Players will have to re-enable ai to do so. NPC plugins using villagers usually already disable their ai. Make sure not to disable and then re-enable the NPC with AVL, as that will cause the NPC ai to reactivate.

Features of the Plugin

Nametags will not be used when renaming villagers. This is just to allow easy renaming of all villagers and not have to spend a bunch of resources getting nametags which will discourage players from using this plugin. You can turn it off in the config.

There is a cooldown between renaming villagers to prevent exploiting vanilla restocking and the plugin restocking from both happening in a single day.

Automatically restocks villagers at two set times which are configurable.

Automatically levels up disabled villagers.

Bugs and Support

If you encounter any bugs please open a github issue. I will try to solve it as soon as possible!

For support, you can join the Discord Server

antivillagerlag's People

Contributors

rebelmythik avatar d-vr avatar evidentsinger14 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.