Amai's Anime Fight
Note: Idea for this plugin is from discord community, join if you have ideas 💖
Overview
The AmaisAnimeFight plugin adds an exciting feature to your Minecraft server: the ability for players to activate a "Target Lock On" mode. This mode allows players to automatically lock onto and aim towards nearby living entities such as other players, mobs, or creatures within a configurable range.
Key Features
1. Toggleable Target Lock On
- Players can enable or disable the "Target Lock On" mode using the
/lo command.
- When activated, the plugin continuously updates the player's orientation to face towards the nearest living entity within the specified range.
2. Stabilized View
- To prevent the screen from feeling too jarring during fast movements and rotations, the plugin features a stabilization factor. This parameter controls how smoothly the player's view transitions toward the target.
- The default stabilization factor is set to 0.1, which offers a balanced level of smoothness. Administrators can adjust this value in the configuration file to suit their preferences.
3. Configurable Settings
- Target Range: Specifies the maximum distance within which players can lock onto living entities.
- Update Interval: Determines how frequently (in ticks) the plugin updates the player's orientation towards the target, allowing for fine-tuning of responsiveness.
- Stabilization Factor: Controls the smoothness of rotation transitions when locking onto a target.
How It Works
Activation:
- Players use the
/lo command to activate or deactivate the Target Lock On mode.
- Upon activation, the plugin begins a task that periodically checks for the nearest living entity within the defined range.
Target Detection:
- The plugin scans a spherical area around the player and identifies all living entities (excluding the player themselves).
- It then determines the closest living entity to the player based on distance.
View Adjustment:
- Once the target is identified, the plugin calculates the necessary rotation (yaw and pitch) for the player's view to face towards the target.
- Using a stabilization factor, the plugin smoothly transitions the player’s orientation over time, rather than instantaneously snapping to the new direction.
Deactivation:
- When the Target Lock On mode is deactivated, the plugin stops updating the player's orientation and cancels any ongoing tasks.
Configuration
The config.yml file provides easy-to-adjust settings that allow server administrators to tailor the plugin’s behavior:
- target-range: The maximum distance within which players can lock onto targets (default: 10 blocks).
- update-interval: The frequency of orientation updates in ticks (default: 1 tick).
- stabilization-factor: The factor controlling the smoothness of rotation transitions (default: 0.1).
- Less-Dynamic-Change: When Player has Target on mob/player and new mob comes closer, target changes after x seconds (0 = change instantly)
Usage Instructions
Install the Plugin:
- Place the
AmaisAnimeFight.jar file into your server’s /plugins directory.
- Restart your server to enable the plugin.
Configure the Plugin:
- Edit the
config.yml file located in the /plugins/AmaisAnimeFight/ directory as needed.
- Save the changes and restart the server to apply them.
Using Target Lock On:
- As a player, type
/lo in the chat to toggle the Target Lock On mode on or off.
- While activated, your view will automatically adjust to face the nearest living entity within range.