Giter Club home page Giter Club logo

baimomodifykb's Introduction

BaimoModifyKB

BaimoModifyKB is a plugin for the Minecraft server software Nukkit. It allows server administrators to modify the knockback distance of players in different worlds.

Installation

To install BaimoModifyKB, simply download the plugin jar file and place it in the plugins folder of your Nukkit server.

Usage

To set the knockback distance for a world, use the /setkb command followed by a float value. For example, to set the knockback distance to 2.0 for the current world, use the command /setkb 2.0.

Configuration

BaimoModifyKB uses a configuration file to store the knockback distances for each world. The default configuration file is generated when the plugin is first enabled and can be found at plugins/BaimoModifyKB/config.yml.

To modify the knockback distance for a world, simply edit the value for that world in the configuration file. The value should be a float representing the desired knockback distance.

Code Overview

The main class for BaimoModifyKB is BaimoModifyKB.java. This class extends the PluginBase class provided by Nukkit and implements the Listener interface to handle events.

The onEnable method is called when the plugin is enabled and is responsible for registering event listeners and loading the configuration file.

The onDisable method is called when the plugin is disabled and is responsible for saving the current knockback distances to the configuration file.

The onEntityDamageByEntity method is an event listener that is called whenever an entity is damaged by another entity. It checks if the damager is a player and if so, sets the knockback distance for the event to the value specified for the world the player is in.

The onCommand method is called whenever a player enters a command. It handles the /setkb command by setting the knockback distance for the world the player is in to the value specified in the command.

Conclusion

BaimoModifyKB is a simple but useful plugin for Nukkit servers that allows server administrators to modify the knockback distance of players in different worlds. It is easy to install and configure, and provides a convenient command interface for setting knockback distances on the fly.

baimomodifykb's People

Contributors

zhou-shilin avatar

Stargazers

 avatar  avatar

Watchers

 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.