Ever wondered what client your players are using and their versions? You can now simply check and determine what course of actions you want to take when they join with a certain client! Maybe even a sussy baka?
Config usage:
Code (YAML):
clients
:
# These serve as keys. You can add as many clients as you like.
vanilla
:
# This are the client-brands that will be matched with players when they join the server. E.g. Players that join
# with the vanilla client brand will be matched to the vanilla client.
brands
:
-
"vanilla"
# These are actions which can be taken when a player using this client joins the server.
join:
permissions:
enabled
: false
list
:
-
"badge.vanilla"
lunar
:
# Some clients register a specific plugin messaging channel, so we can use that to 100% detect if the player is
# using an authentic client.
channel
:
"lunarclient:pm"
join:
permissions:
enabled
: true
list
:
-
"badge.lunar"
commands:
enabled
: true
list
:
-
"lp user {user} parent add lunar"
messages:
enabled
: true
list
:
-
"{prefix} &aYou have joined with Lunar"
leave:
commands:
enabled
: true
list
:
-
"lp user {user} parent remove lunar"
# You can list more than 1 client brands if there are multiple versions of the same client.
forge:
brands
:
-
"forge"
-
"fml"
channel
:
"FML"
join:
permissions:
enabled
: true
list
:
-
"badge.forge"
commands:
enabled
: true
list
:
-
"lp user {user} parent add forge"
messages:
enabled
: true
list
:
-
"{prefix} &aYou have joined with Forge"
leave:
commands:
enabled
: true
list
:
-
"lp user {user} parent remove forge"
# If you want to group clients together, you can also do that.
sussyclients:
brands
:
-
"solarclient"
-
"fabric"
-
"lunarclient:5373836"
join:
permissions:
enabled
: true
list
:
-
"badge.sussy"
commands:
enabled
: true
list
:
-
"lp user {user} parent add sus"
messages:
enabled
: true
list
:
-
"{prefix} &cYou have joined with a sussy client"
leave:
commands:
enabled
: true
list
:
-
"lp user {user} parent remove sus"
# This is an example of what you can add
client-etc:
brands
:
-
"clientbrand1"
-
"clientbrand2"
join:
permissions:
enabled
: false
list
:
-
"badge.otherclient"
commands:
enabled
: false
list
:
-
"lp user {user} parent add other"
messages:
enabled
: false
list
:
-
"{prefix} &cYou have joined with {clientname}"
Commands & Permissions:
- /cc version [player]
(clientchecker.staff)
- /cc client [player]
(clientchecker.staff)
- /cc server
(clientchecker.server)
- /cc reload
(clientchecker.staff)
Version Checking Dependencies: (If you want to get an accurate client version)
- ViaVersion
(Recommended)
- ProtocolLib
- ProtocolSupport
Other Dependencies:
- PlaceholderAPI
(%clientchecker_client%, %clientchecker_version%)
For developers:
Maven Repository
Code (Text):
https://repo.destial.xyz/repository/maven-releases
Dependency:
Code (Text):
<dependency>
<groupId>xyz.destiall</groupId>
<artifactId>clientchecker</artifactId>
<version>1.2</version>
<scope>provided</scope>
</dependency>
Code (Java):
// Access the api via casting the plugin
ClientCheckerAPI api
=
(ClientCheckerAPI
) Bukkit.
getPluginManager
(
).
getPlugin
(
"ClientChecker"
)
;
ClientUser user
= api.
getUser
(player
)
;
Client client
= api.
getClient
(client
)
;
user.
getPlayer
(
)
// Get the Bukkit player
user.
getClientBrand
(
)
// Get the player's client brand
user.
getVersion
(
)
// Get the version of the player (E.g. 1.8, 1.17)
user.
getId
(
)
// Get the UUID of this player
user.
getClient
(
)
;
// Get the current client of this player
client.
getBrands
(
)
// Get the brands affiliated with this client
client.
getChannel
(
)
// Get the plugin messaging channel linked to this client (can be null)
client.
hasBrand
(string
)
// Check if this client is associated with the given brand string
client.
addPermission
(string
)
// Add a join permission for this client
client.
addCommand
(string
)
// Add a join command for this client
client.
addMessage
(string
)
// Add a join message for this client
client.
addLeaveCommand
(string
)
// Add a leave command for this client
P.S. When you reload the plugin, the Client objects gets wiped and reloaded from the config.yml.