
EssentialsX-Target-Selectors
This minecraft plugin adds @a, @p, and @r to EssentialsX Commands! Works with command block and console aswell!
Usage:
Just pop this into your server, and it will just work! No commands, no config no nothing! As simple as could be.
How is this helpful and what does it do?
The very popular plugin EssentialsX, has never had support for target selectors like @a, or @p. And especially when working with command blocks, those selectors would be very helpful if they existed, But with this plugin, they do!
@a - all players @p - closest player @r - random player @s - yourself
Note: @p and @s can NOT be run from the server console, and @s can NOT be used in command blocks.
Examples: Without plugin (normal essentialsX)
/give @a dirt -> Unknown player @a
/kill @p -> Unknown player @p
give @r diamond 5 - > Unknown player @r
With Essentials Selectors Plugin:
/give @a dirt -> *gives every player on the server dirt*
/kill @p -> *kills the closest player*
give @r diamond 5 - > *gives a random player 5 diamonds*
You can also use specifications for selectors, for example: "@r[team=killMe]"
Examples:
- "/kill @a[distance=..8,tag=KillMe]
- "/feed @r[distance=..250]
For a list of all specifications, and how to use them, refer to the Minecraft Wiki HERE.
IMPORTANT:
This plugin does not replace EssentialsX! You still need to install the orginial EssentialsX plugin for this to work!
All Versions
+ Add VersionThank you so much to [Colbster937](https://github.com/colbster937) for [their pull request](https://github.com/DogLoverPink/EssentialsX-Target-Selectors/pull/19) on github!
@n or @e, as Essentials commands are fundamentally incompatible with such selectors.)- Fixes [#17](https://github.com/DogLoverPink/EssentialsX-Target-Selectors/issues/17) (hopefully)
- Implements [#16](https://github.com/DogLoverPink/EssentialsX-Target-Selectors/issues/16)
Unfortunately, the code under the hood for this plugin is still pretty rough overall, and unfortunately there is still no tab completion for the selectors, but I hope to address both of these issues down the line.
Thank you to [xgioa](https://github.com/xgioa), [wrjgrrgpmc-hash](https://github.com/wrjgrrgpmc-hash), and [hellfirehd](https://github.com/hellfirehd) for their reporting and feedback!
Thanks to [@ardse](https://github.com/ardse) for reporting!
Remember to check out the [new features](https://www.spigotmc.org/resources/essentialsx-selectors-a-p-r-addon.101057/field?field=documentation) present in v2.0!
### What does this change?
- Much more maintainable back end, way easier to contribute as well
- Updates will be quicker, bug fixes will be easier and faster
- The system is way more modular: there is very little hard-coding and bad practices (which is just better for everyone)
- More efficient; the tiniest little bit faster than the previous version, but you won't notice it
- Added the ability to use and (&) and or (|) operators is specifications.
- Example 1:
/kill @a[tag=dog|cat&!rat]would mean "kill all players with the tag "dog" OR "cat", and they don't have the tag "rat" - Example 2:
/feed @r[team=red|blue|green,tag=player&!staff,gamemode=!creative&!survival]would mean "feed all players on team "red" or "blue" or "green", who has the tag "player" and not the tag "player, who's gamemode is not survival or not creative. - Due to the logic of how it work, you always need to put all of your OR statements before your AND statements, so for example,
/kill @a[tag=red&blue|green]would NOT work, due to the implementation of this system.
- Fixed [#11](https://github.com/DogLoverPink/EssentialsX-Target-Selectors/issues/11). Thanks to [@Skyw0lf07](https://github.com/Skyw0lf07) for reporting it!
- Refactored project structure a bit
- Switched to using Maven
- Formatted some files better
Thanks [@RealTriassic](https://github.com/RealTriassic) for reporting!
- Additions:**
- Added a team specification for selectors, usage is [team=coolTeam] or [team=!green]. (Check documentation on the spigot page for more info). **Important note: The team display name is different from the actual name, make sure to use the actual name of the team when using.**
- Added support for all plugins in the EssentialsX franchise.
- Changed and bug fixes:**
- Fixed an issue with the @<!-- -->p selector being used with players in different worlds.
- Changed some default permissions from 'op' to 'true', meaning that every player can use selectors by default.
This update adds specifications for selectors, for example: "@r[gamemode=creative]"
- There are 5 specifications that can be added to any selectors:**
- gamemode
- tag
- limit
- distance
- level
# For a list of what all of these do, and how to use them, refer to the spigot page documentation HERE.