mvdw-placeholders-custom
-
Custom placeholders for MVdW-Software plugins
When talking about custom placeholders there are two types.
- Custom placeholders coded in a separate plugin that hooks into a MVdW-Software plugin
- A javascript based placeholder that is created in the placeholder_custom.yml file under the directory /placeholders/ inside the plugins data folder.
http://dl.mvdw-software.be/manuals/SpigotAnimationPluginsDevelopersGuide.pdf
This API example is from ActionBar, but the same applies to other plugins
Code (Text):package be.maximvdw.rainbownamesplaceholder;
import org.bukkit.ChatColor;
import org.bukkit.plugin.java.JavaPlugin;
import be.maximvdw.featherboard.api.PlaceholderAPI;
import be.maximvdw.featherboard.api.PlaceholderAPI.PlaceholderRequestEvent;
import be.maximvdw.featherboard.api.PlaceholderAPI.PlaceholderRequestEventHandler;
public class RainbowNamesPlaceholder extends JavaPlugin {
@Override
public void onEnable() {
super.onEnable();
PlaceholderAPI.registerOfflinePlaceholder("rainbowname", true,
new PlaceholderRequestEventHandler() {
@Override
public String onPlaceholderRequest(PlaceholderRequestEvent e) {
String playerName = e.getOfflinePlayer().getName();
String newName = "";
for (int i = 0; i < playerName.length(); i++) {
newName += ChatColor.values()[i]
+ String.valueOf(playerName.charAt(i));
}
return newName;
}
});
}
}
Code (Text):
## --------------------------------------- ##
## Custom Skript Placeholders
## --------------------------------------- ##
## Do not edit this config version
config: 1
# Add your own placeholders under this category
placeholders:
ismaximcool: # this would be used as {ismaximcool}
condition: "true" # has to be 'true' or 'false' (in this case ofc true)
true: "Ofc he is"
false: "ERROR"
healthyornot: # this would be used as {healthyornot}
condition: "{health} > 10" # You can use other placeholders here
true: "&aYou are healthy!"
false: "&cEat something ..."
nearbed: # this would be used as {nearbed}
# So, this gets the absolute difference of your position minus your bed position and checks if its closer then 10
condition: "(Math.abs({x} - {bed_x}) < 10) && (Math.abs({y} - {bed_y}) < 10) && (Math.abs({z} - {bed_z}) < 10)"
true: "You are close"
false: "Not so close" - Loading...
- Loading...
XenCarta PRO
© Jason Axelrod from 8WAYRUN.COM