Project Essentials Core
Documentation for Project Essentials Core users and developers, describing commands, permissions and API methods and other.
This is the base module (core
) for all other Project Essentials modules. It contains the necessary dependencies that are used in other modules, for example Kotlin std lib and Kotlinx Serialization and Brigadier, this core also contains common code, for example, the initialization process and some extensions of existing forge classes, which can be useful and can reduce duplicate code.
How to Install
For start the modification, you need installed Forge, it is desirable that the version matches the supported versions. You can download Forge 1.14.4 from the link and Forge 1.15.2 from it link. Move the downloaded mod (marked -MOD
in the file name) to the mods
folder (installation example below).
If there is already a modification that loads the kotlin
and kotlinx serialization
libraries, then download the -API
modification, instead of -MOD
.
Dependencies
Also do not forget to install dependencies, only two types of dependencies: mandatory (game will not start without a mod) and recommended (without a mod, game can start, but I recommend using it).
Download dependencies: Cooldown ยท Permissions
Let's check it!
Now try to start the game, go to the mods
tab, if this modification is displayed in the mods
tab, then the mod has been successfully installed.
Vanilla Replacements
For compatibility with the Permissions module, all the native Vanilla commands have been rewritten in the Core module, they simply replace them with the addition of a check for the permissions and operator level.
In this regard, if you have the Permissions module installed, you will need to issue permissions to the native Vanilla commands. By default, all commands (with operator level 0) available to the player will be available (they are pre-registered in the permissions). The permissions to use the native Vanilla commands are very simple and consist of the command name itself, for example: native.time
(for the/time
command), or for example: native.ban
(for the/ban
command). Exceptions: /me
, for this command the right is native.message
.
Commands aliases
Command aliases are declared in the configuration, by default several popular aliases are made to which many players are used to, they are described in the table below.
Command
Aliases
/advancement
/achievements
, /ac
/ban-ip
/banip
/clear
/clearinventory
, /ci
/debug
/dbg
/defaultgamemode
/defaultgm
/effect
/potion
, /eff
/experience
/exp
, /xp
/function
/fun
, /fn
/gamemode
/gm
/list
/online
/locate
/find
, /where
/me
/action
, /describe
/pardon
/unban
/pardon-ip
/pardonip
, /unbanip
/publish
/openlan
/save-all
/saveall
/save-off
\ save-on
/saveoff
, /saveon
/spawnpoint
/respawnhere
/summon
/spawnmob
/tellraw
/tr
/worldborder
/wb
Configuration
Configuration location
Configuration documentation
Below is a table with documentation for some properties from the configuration of native commands.
Property name
Type
Description
nativeReplace
Boolean
If the value is true
, then the core module
implementation of the native Vanilla commands will be used.
disableSafelyEnchantLevel
Boolean
locateFindRadius
Int
Specifies the object search radius for the /find
command.
aliases
Object
Stores alias settings for commands.
aliases.[command name]
List<String>
Stores aliases for a specific command.
Using as API
Dev. Dependencies 1.14.4
Dev. Dependencies 1.15.2
Get as Dependency
:: Only for Forge 1.14.4 ::
:: Only for Forge 1.15.2 ::
API Consts
Path
Description
Type
EssBase.Companion.baseClassPath
Base class path of Project Essentials, includes domain, maintainer and project name.
String
EssBase.Companion.permissionAPIClassPath
Class path of PermissionAPI
module.
String
EssBase.Companion.cooldownAPIClassPath
Class path of CooldownAPI
module.
String
API Functions
Path
Description
Return
Accepts
EssBase.logBaseInfo
Print base modification information to log.
Unit
Nothing
EssBase.validateForgeVersion
Validate forge version on compatibility with loaded mod. If validation failed, then you will be notified with messages in logger with level WARN
.
Unit
Nothing
API Extensions
Path
Description
Return
Accepts
CommandContext.isPlayerSender
Return true
if command sender is player.
Boolean
Nothing
CommandContext.playerName
if command source is player then nickname from CommandContext
. If command source is server then return "#server".
String
Nothing
CommandEvent.commandName
Return command name as string from command event. Example: player execute command /heal MairwunNx
, then you get heal
as string.
String
Nothing
CommandEvent.executedCommand
Fully executed command as string. (With slash and arguments).
String
Nothing
CommandEvent.isPlayerSender
Return true
if source is player.
Boolean
Nothing
CommandEvent.player
Return ServerPlayerEntity?
class instance from CommandEvent
class instance. If source is server then return null
ServerPlayerEntity?
Nothing
CommandEvent.source
Return command source
from CommandEvent
class instance.
CommandSource
Nothing
CommandSourceExtensions.sendMsg
Send localized message to player without logging.
Unit
See below.
String.capitalizeWords
Capitalizes each word string.
String
Nothing
String.Companion.empty
Empty string.
String
Nothing
@ CommandSourceExtensions.sendMsg
arguments:
Name
Type
Description
moduleName
String
Mod module name.
commandSource
CommandSource
Command source instance.
l10nString
String
Localized string without project_essentials_
.
args
List<String>
Additional arguments for localized string (%s literals)
.
API Helpers
Path
Description
Return
Accepts
ForgePathHelper.getRootPath
Absolutely path to configuration root dir.
String
ForgeRootPaths
ModErrorsHelper.<ERROR_ID>
String
Nothing
ModPathHelper.CONFIG_FOLDER
Minecraft config folder absolutely path.
String
Nothing
ModPathHelper.MOD_CONFIG_FOLDER
Project Essentials mod config folder.
String
Nothing
JsonHelper.jsonInstance
Common json instance with default configuration for Project Essentials modules, if module using json configuration, then you need use this property.
Json
Nothing
NativeCommandUtils.removeCommand
Just remove vanilla or other registered command.
Unit
String [commandName]
If you have any questions or encounter a problem, be sure to open an issue
Last updated
Was this helpful?