ModsJava
Forcefield - Execute Commands Based on Player Distance
Java mod listed for Minecraft 1.12. Downloads from the MC Java Mods app on Android.
⬇ Download on SpigotForcefield is a simple plugin that allows you to configure custom forcefields that can execute commands when a set player, or any player, enters and/or exits the set radius of the person with the forcefield active.
The only configuration is currently the Forcefields.yml file. Here you can configure your own forcefield types. Here's what it looks like:
This is my first major plugin, so I greatly appreciate any feedback. I plan to improve the plugin in the future, so any suggestions are welcome. If you have an issue with the plugin, leave a detailed description of the problem in the discussion and I will do my best to fix it as soon as possible.
- Configure your own forcefields with any number of commands that will be executed by the console when a player enter or leaves the set range.
- Set whether you want the enter commands to constantly repeat while the player is in the radius, or only execute once (when the player enters the radius).
- Add a forcefield type to a player with a singular target (only activate for that player), or to target every player (use "all" as the target).
- /forcefield list - Lists all configured forcefields.
- Permission: forcefield.list
- /forcefield inspect <player> - List the forcefields a player has active, as well as their targets.
- Permission: forcefield.inspect
- /forcefield add <player> <forcefield> <target> - Add a configured forcefield type to a player. The target is the player that must be within the radius in order for the commands to execute. If you'd like the forcefield to activate for any player, use "all" as the target. If "all" is a target, then any player also set as a target will be exempt (having the targets "all" and "player1" will execute the forcefield commands for any player that enters the radius except for player1).
- Permission: forcefield.modify
- /forcefield remove <player> <forcefield> - Remove a forcefield type from a player. This also removes all the targets they have for this forcefield.
- Permission: forcefield.modify
- /forcefield removetarget <player> <forcefield> <target> - Remove a certain target from the forcefield of a player.
- Permission: forcefield.modify
The only configuration is currently the Forcefields.yml file. Here you can configure your own forcefield types. Here's what it looks like:
Code (Text):
Example:
name: Example
# The radius that the target must enter/exit in order to execute commands. This is a 3d distance, so y value is also considered.
radius: 5
# How commands are executed - enter "both" for enter and exit commands, or "enter" or "exit" for just those.
type: both
# Whether the enter command is repeated while the player remains in the radius. If false, the enter command only executes once when the target enters the radius.
repeat: false
# Commands on enter and exit. If you don't want any commands to execute, use "none". You can list as many commands as you want, one per line. A slash is not needed.
EnterCommands:
- time day
ExitCommands:
- time night
name: Example
# The radius that the target must enter/exit in order to execute commands. This is a 3d distance, so y value is also considered.
radius: 5
# How commands are executed - enter "both" for enter and exit commands, or "enter" or "exit" for just those.
type: both
# Whether the enter command is repeated while the player remains in the radius. If false, the enter command only executes once when the target enters the radius.
repeat: false
# Commands on enter and exit. If you don't want any commands to execute, use "none". You can list as many commands as you want, one per line. A slash is not needed.
EnterCommands:
- time day
ExitCommands:
- time night
This is my first major plugin, so I greatly appreciate any feedback. I plan to improve the plugin in the future, so any suggestions are welcome. If you have an issue with the plugin, leave a detailed description of the problem in the discussion and I will do my best to fix it as soon as possible.
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.12
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
Forcefield - Execute Commands Based on Player Distance is a free Minecraft Java mod. Compatible with Minecraft 1.12. Downloaded 228 times (via Spigot). Download it and open it directly in the game.