Description
Getting Started
Installation:
- Download the latest version from Releases or CurseForge.
- Install it into the server's
modsfolder. - Start the server.
Commands:
/placeholders check (argument)- Check any placeholder in real-time./placeholders reload- Reload the plugin.
Permissions:
fplaceholders.check- Permission to use the check command.fplaceholders.reload- Permission to use the reload command.
Javascript
The mod allows using Javascript code for placeholders. All scripts are located in the javascript folder in the plugin's root directory. Scripts do not need to be registered in the main configuration; it happens automatically.
File: test.js
function checked() {
return "Hello, Friend";
}
checked();
Usage - %javascript_test%
Examples showing different use cases:
var placeholder = papi("%player_prefix%");
function checked() {
return placeholder;
}
checked();
var placeholder = player.getUsername();
function checked() {
return placeholder;
}
checked();
! The (player) object is provided to every .js placeholder called for a player. If called without a player context, it returns null.
Extensions
You can create your own plugins using the API. You can also create mini-scripts (.jar) that are placed directly into the fPlaceholders/plugins folder.
Maven:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.FLOERKA</groupId>
<artifactId>fPlaceholders</artifactId>
<version>Version</version>
</dependency>
Gradle:
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.FLOERKA:fPlaceholders:Tag'
}
Example of using the API to create placeholders:
package ru.floerka.placeholdertest;
import com.hypixel.hytale.server.core.Message;
import com.hypixel.hytale.server.core.universe.PlayerRef;
import ru.floerka.placeholders.api.CustomPlaceholder;
import ru.floerka.placeholders.manager.models.ExecutePlaceholder;
public class CustomExpansion extends CustomPlaceholder {
@Override
public String getAuthor() {
return "floerka";
}
@Override
public String getPrefix() {
return "test";
}
@Override
public String onServerRequest(ExecutePlaceholder placeholder) {
String arg = placeholder.getArgs()[0];
return "You entered: " + arg;
}
@Override
public String onPlayerRequest(PlayerRef playerRef, ExecutePlaceholder placeholder) {
String arg = placeholder.getArgs()[0];
playerRef.sendMessage(Message.raw("You used a placeholder!"));
return "You entered: " + arg;
}
}

