Skip to content

SQuazar/OfflineManager

Repository files navigation

OfflineManager

Description

As you know, offline players cannot be edited in vanilla minecraft without using utility programs, but using the OfflineManager plugin, you can use the list of functions to edit the player you need! The plugin also provides API for developers, with which you can add your own functions.

Features

  • Has API
  • PlaceholderAPI support
  • Permissions support
  • Offline player management
  • Search for offline players using TAB
  • Has configuration plugin

Installation

To install the plugin, transfer the plugin to the plugins folder and restart or reload the server. If you update plugin to 3.0 version, recommended remove config.yml and messages.yml files.

Commands & Permissions

Command Aliases Description Permission
/offlinemanager om OfflineManager main command offlinemanager.use
/om help none Get plugin help page offlinemanager.use
/om invsee [player] none Open player's offline inventory offlinemanager.invsee
/om invsee [player] armor none Open player's offline armor inventory offlinemanager.invsee.armor
/om enderchest [player] ec Open player's offline ender chest offlinemanager.enderchest
/om reload [player] none Reload the plugin configuration offlinemanager.reload
/om teleport [player] tp Teleport to offline player offlinemanager.teleport
/om tphere [player] none Teleport an offline player to you offlinemanager.tphere
/om adventure [player] none Set the adventure mode to the offline player offlinemanager.adventure
/om creative [player] none Set the creative mode to the offline player offlinemanager.creative
/om survival [player] none Set the survival mode to the offline player offlinemanager.survival
/om spectator [player] none Set the spectator mode to the offline player offlinemanager.spectator
/om clear [player] none Clear the offline player inventory offlinemanager.clear
/om kill [player] none Kill the offline player offlinemanager.kill
/om heal [player] none Heal the offline player offlinemanager.heal
/om feed [player] none Feed the offline player offlinemanager.feed

Placeholders

For all placeholders use om_ prefix!

Placeholder Description
player_name Returns the player name
player_uuid Returns the player's uuid
player_healths Returns the player's healths count
player_food Returns the player's food count
player_locX Returns the player's x coordinate
player_locY Returns the player's y coordinate
player_locZ Returns the player's z coordinate
player_locYaw Returns the player's yaw
player_locPitch Returns the player's pitch
player_locWorld Returns the player's world name

Placeholders usage

In order to get information from the player you need, you must:
  • Install PlaceholderAPI
  • Install ParseOther using /papi ecloud download ParseOther
  • Use parseother_{playername}_{om_placeholder} in placeholders

Examples

Placeholder Result
parseother_{playername}_{om_player_uuid} Return the player's uuid
parseother_{playername}_{om_player_locX} Return the player's x coordinate

Message configuration placeholders

Message Placeholders
permission-deny %player%, %permission%, %function%
enter-nickname %player%, %permission%, %function%
enter-subcommand %player%, %permission%, %function%
player-not-found %player%, %target%, %permission%, %function%
player-is-online %player%, %target%, %permission%, %function%
command-not-found %player%, %command%
function-disabled %player%, %function%, %permission%
already-being-edited %player%, %target%, %permission%, %function%
teleport-success %player%, %target%, %permission%, %function%
teleport-here %player%, %target%, %permission%, %function%
teleport-another %player%, %target%, %to%, %permission%, %function%
gamemode-changed %player%, %target%, %gamemode%, %permission%, %function%
heal-player %player%, %target%, %permission%, %function%
kill-player %player%, %target%, %permission%, %function%
feed-player %player%, %target%, %permission%, %function%
clear-inventory %player%, %target%, %permission%, %function%
Placeholders description
Placeholder Returns
%player% Command sender name
%target% Target offline player name
%permission% Permission name
%command% Command name
%function% Function name
%to% The name of the player to which the offline player is teleported
%gamemode% GameMode name

Also messages support the placeholders from PlaceholderAPI

Maven

<repositories>
    <repository>
        <id>codemc-repo</id>
        <url>https://repo.codemc.io/repository/maven-public/</url>
    </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>net.quazar.offlinemanager</groupId>
        <artifactId>api</artifactId>
        <version>VERSION</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

Gradle

repositories {
    maven {
        url 'https://repo.codemc.io/repository/maven-public/'
    }
}
dependencies {
    implementation 'net.quazar.offlinemanager:api:VERSION'
}

API Usage

Installation & Usage

package net.example;

import net.quazar.offlinemanager.api.OfflineManagerAPI;
import net.quazar.offlinemanager.api.data.entity.IPlayerData;
import net.quazar.offlinemanager.api.enums.SavePlayerType;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull;

public class Example extends JavaPlugin {

    private OfflineManagerAPI offlineManagerAPI;

    @Override
    public void onEnable() {
        Plugin plugin = Bukkit.getPluginManager().getPlugin("OfflineManager");
        if (plugin == null) {
            getLogger().severe("Could not find OfflineManager! This plugin is required!");
            Bukkit.getPluginManager().disablePlugin(this);
            return;
        }
        offlineManagerAPI = (OfflineManagerAPI) plugin; 
        Bukkit.getPluginCommand("example").setExecutor(this);
    }

    @Override
    public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) {
        if (!(sender instanceof Player))
            return false;
        Player player = (Player) sender;
        String playerName = args[0];
        if (!offlineManagerAPI.getStorage().hasPlayer(playerName))
            return false;
        String sub = args[1];
        IPlayerData playerData;
        switch (sub.toLowerCase()) {
            case "teleport":
                playerData = offlineManagerAPI.getPlayerData(playerName);
                player.teleport(playerData.getLocation());
                break;
            case "feed":
                playerData = offlineManagerAPI.getPlayerData(playerName);
                playerData.setFoodLevel(20);
                playerData.save(SavePlayerType.FOOD_LEVEL);
                break;
            default:
                sender.sendMessage("Sub command not found");
                break;
        }
        return true;
    }
}

Support

Links