promotional bannermobile promotional banner

fPlaceholders

A powerful mod for placeholders on the Hytale server (javascript included)

Getting Started

Installation:
  1. Download the latest version from Releases or CurseForge.
  2. Install it into the server's mods folder.
  3. 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&lt;/url&gt;
        </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;  
    }  
}

The fPlaceholders Team

profile avatar
Owner
  • 1
    Projects
  • 29
    Downloads