Data Packs Server Utility

fafik77 main.Lib 2

  • 3.7k views 0 today
  • save_alt 123 downloads
Compatibility
Minecraft 1.15
to version
Minecraft 1.21
Changes include
  • Advancements
  • Functions
  • Loot Tables
  • Predicates
  • 5
  • 2
  • 5
fafik77
Lvl 66High Grandmaster Miner
54

fafik77 main.Lib 2

this core datapack is an unified collection of functions and events for depended datapacks (most of my packs).
Also connects my mods with my datapacks:
Data Command Plus (mod by fafik77) server side mod to make some commands more performant

/reload

executing /reloadwill show a single line of interactive text
Reloading !
fafik77 DataPacks installed List 7 Config
List 7Config
Click: Lists all fafik77 datapacks,shows the current version of "fafik77 main.Lib" and Resource Pack in viewed language en_us.Shows how many fafik77 datapacks have been reportedClick: Lists all datapacks that are configurable
if datapack is configurable its name in the List will be clickable

Joining the world

When a player joins the world
if they join for the first time "event/player_new" will notify all listeners of that, and a new player id will be assigned to them.
also by default everytime they join:
ResourcePack fafik77 LanguagePack date: 2024-09-11 (1)
will be shown, with the obvious date of the resource pack.
the mysterious (1) is the player id, if you know it its much easier to use eg. Tpr Tpa

Events

Events fired: for more details open up ".zip/data/fafik77/tags/functions/fafik77_main"
Event/
awaits_playerany player joined the game to show them the error code
player_changed_name
migrate_player
player joined with new user name (but is not a new player)
player_newnew player joined
player_log_inplayer logged in
player_diedplayer died
player_avoided_death
used_totem
player used a totem to escape death
player_respawnedplayer respawned after death
player_data
player_data_off
player_data_any
Since 1.21+ moved to Data Command Plus
(each tick for each player) iterates data storage to access this players data
world_spawn_changed/setworldspawn command was used
inventory_manager/
slothook into inventory_manager
personal_upgrade_manager/
add_itemadd effects of the item to player
add_item-finishall items have been added
add_item-start
remove_echest_tagsplayer stepped away from ender chest (when editing items)
remove_itemremove single item
remove_itemsremove all items
./
loadafter fafik77 main Lib/load
tickafter fafik77 main Lib/tick
print_installed
print_installed_adds
register a datapack, that reports its existance only when admin chooses to see this list
print_config_listadd an entry to Config List, shown on /reload Config
foreach_playerticks for @a players in uniform fassion

Functions

Usable functions: for more details open up ".zip/data/fafik77/tags/functions/fafik77_main"
inventory_manager/
Manipulates slots in player inventory
swap_mainhand_slotswap old mainhand slot with new mainhand slot
replace/allmerges new inventory onto old one
restore/overlapping_giverestores items twat were overwritten by replace/all
Usage".zip/-auto/inventory_manager/data structure and usage.json"
  1. /data remove storage minecraft:fafik77 Data.InventoryManager
  2. set storage minecraft:fafik77 Data.InventoryManager.old.Inventory from entity @s Inventory
  3. set storage minecraft:fafik77 Data.InventoryManager.new.Inventory value [{ new player inventory items array }]
  4. run /function fafik77:fafik77_main/inventory_manager/main_calc
  5. /function fafik77:fafik77_main/inventory_manager/replace/ OPTION
  6. ** /function fafik77:fafik77_main/inventory_manager/restore/overlapping_ METHOD
  7. /data remove storage minecraft:fafik77 Data.InventoryManager
json_parser/
all functions that are in this folder are usable (if Mod Data Command Plus is installed)
rng/
rand -can return numbers in configured rangefor minecraft 1.20.2+ use the /random command, or use loot table to set item count
shulkers/
set_shulker(2) has to be followed by unset_shulker(2), its usefull for placing a temporary shulker box at #this location and restoring the block when unsetnow uses /loot .. inventory from DCP
villager_recipe-table_parser/ 1.21
parse -used by Book Loving Villagers datapack, can be used to generate trades from loot table

Tags & Data

Usefull tags and data
Tags
f77_main_aliveplayer is alive now
f77_main_newPlayerTnew player joined in this tick (connect to #fafik77:fafik77_main/tick)
fafik77_player_log_inplayer joined in this tick (connect to #fafik77:fafik77_main/tick)
Scores
f77_playerIdstores each player their id
_VersionMainLib f77_main_TMPversion of fafik77 main lib, in format yyyyMMdd
_mcVersion f77_main_TMP(1).20.4 = 2004
Data Storage
storage minecraft:fafik77 Data.current_player[-1]
storageplayer @s (Data Command Plus)
stores each player data

Advacements root:

  • child advacements are placed under this tab (a child can NOT exist without its parent root)

Old Downloads


10 Update Logs

2025-01-25 updated to 1.21.4+ : by fafik77 01/25/2025 8:53:05 amJanuary 25, 2025 @ 1:53 pm UTC

updated to 1.21.4+
LOAD MORE LOGS

More like this

  Have something to say?

M4g1kz
05/13/2020 11:26 pm
Level 1 : New Miner
So what does this do with the shulker box exactly, and how does it influence things? Would this work with a pack that modifies the drop rate of the shulker shells? I feel like that part needs to be explained a bit more before some people will give it a shot.
1
fafik77
05/14/2020 12:25 pm
Level 66 : High Grandmaster Miner
history
this pack is required by my datapacks, by itself it changes nothing that's already in the game (except it modifies 1 file which is loot_table/blocks/shulker_box by adding an method to give player the shulker_box content instead of giving him the shulker_box itself, this method can only by utilized using commands, it does not affect survival game)

and perhaps you did read "shulker" instead of "shulker_box" which is the pocked chest and not the alive Monster

*since 1.21.0 this datapack uses DCP mod, and it no longer modifies any loot_table
2
M4g1kz
05/14/2020 7:40 pm
Level 1 : New Miner
Thanks for this reply!
1
CraftMaster6875
05/10/2020 4:10 pm
Level 19 : Journeyman Crafter
what is this?
1
fafik77
05/01/2020 9:15 am
Level 66 : High Grandmaster Miner
history
so i don't know what happened with the text here, but it was fine right after publication

*Edit. i give up this is worse than word
1

Welcome