▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/Silver Star Library

Silver Star Library

A library for Minecraft Datapack developers, that adds pre-established scores, predicates, and modules to simplify development.

9
0

Silver Star Library is a development tool for datapack creators. It was originally a library I created for my own use, but its usage is not specifically catered to my own projects, and can be used across a wide variety of applications.

Please note! For many features of SSL, you will be required to invoke the ss_lib:_pre_function and ss_lib:_post_function functions. These files are designed to be run before all other functions, and after all other functions, respectively. I achieve this by having a "core" module which invokes these functions at the proper time, but do it however you like.

Features

Scores

SSL adds a wide array of scores that cover entity data, condition, location, and more. These scores can be called as needed through a group of "fetch" functions, which have a built-in check for whether they've already been called in the same tick. This drastically increases efficiency compared to calculating scores every tick, because it allows scores to only be calculated when necessary, and means that there won't be redundant calculations.

Generic Scores

SSL also adds five "generic" scores, along with basic integer scores. "generic" scores are meant to be assigned and used in a single function, as they act just as temporary, placeholder scores. The basic integer scores are used for basic arithmetic operations, again, to cut down on the amount of extraneous, single-use scoreboard objectives.

Quick Destroy Items

SSL adds in a module that allows items to be designated as "quick destroy" items. These items, when dropped on the ground, will disintegrate after five seconds.

Items are designated as Quick Destroy just by adding quick_destroy:true to the custom item data.

Particles

SSL adds in a Particles module, which is just a group of preset particle effects. Most of these effects come from my personal projects, so there's not much of a theme to them. However, they are used for the Quick Destroy module.

Score Parse Module

The Score Parse Module is a sub-module of SSL that takes a macro input of a scoreboard objective and a function, and outputs the value of the scoreboard objective into the target function, as a macro. For example, if a player has a Test score of 50, and they want their maximum health attribute to always match their Test score, the Score Parse Module can read their score and output a string of "50" into the target function. SPM also has the ability to prepend, append, and insert special characters, allowing scores to be converted to floats.

In essence, the Score Parse Module is used to convert scores into macro strings.

A full breakdown of SPM is in a README file in its functions folder.

Raycast Module

The Raycast module adds a group of functions for creating raycasts, for instant straight-line block or entity detection. It allows input of how far the raycast should travel, the integer between each raycast node, and the target block, entity, or both. If the raycast succeeds, and detects the target, it will then run the function the developer specifies.

A full breakdown of the Raycast module is in progress, but feel free to DM me on Discord (@skeleton.toast) if you have any questions.

Rounding Module

The Rounding module is used to increase precision of scores when they're divided. By default, Minecraft will always round scores down to the nearest integer. However, the Rounding module will properly round these values instead of rounding them down every time.

The rounding module is pretty straight forward. It takes one input parameter, "score" which is the scoreboard objective that will be rounded for the executing entity.

Run Module

The Run module is a developer tool for discreet command execution, and easy command repetition. The Run module allows you to specify what command to run and how many times to run it, and in any server console or chat log, the only message displayed will be that the Run function was called. The specific command that was run will not be displayed.

The Run module takes two input parameters, "f" and "r". "f" is the full command to run, and "r" is the amount of times to run it.

Auto-Whitelist

The Auto-Whitelist function is a way to prevent developers from accidentally banning, blacklisting, or de-oping themselves from a server. It can be found in the ss_lib:_load function. Replacing the template username with your username will ensure that your account continues to have the correct permissions tied to it.

Unique Relationship Identifier

The Unique Relationship Identifier, or URID, is used to establish a connection between two entities using as-needed URID scores. The urid:assign function assigns a unique URID to the targeted entity, and that URID can be used to establish the connection. For example, if a developer wants to assign two players as "best friends", they would create a "best friend URID" score, and then set that score to the same value for both players (this value would ideally be written from one of the players' default URIDs). Now, since those players share the same Best Friend URID score, they have an established connection that perseveres even when one or both of them are offline.

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Детали

Лицензия:LGPL-3.0-or-later
Опубликован:1 месяц назад
Обновлён:3 недели назад
Главная