• check_circle Advancements
  • check_circle Functions
  • check_circle Loot Tables
  • check_circle Predicates
  • 3,347 views, 1 today
  • 119 downloads, 0 today
  • 5
  • 2
  • 5
fafik77's Avatar fafik77
Level 64 : High Grandmaster Miner
53

fafik77 main.Lib

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

Events

Events fired: for more details open up ".zip/data/fafik77/tags/functions/fafik77_main"
Event/
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
(each tick for each player) iterates data storage to access this players data (use Data Command Plus to increase performace)
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_installed-main

Functions

Usable functions: for more details open up ".zipdatafafik77functionsfafik77_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 range
for 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 unset
villager_recipe-table_parser/
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



!!! pack modifies "loot_table/blocks"
  • shulker_box its the only way to give modified items back to player (where they belong) pre 1.18?
Advacements root:
  • child advacements are placed under this tab (a child can NOT exist without its parent root)
CompatibilityMinecraft 1.15
toMinecraft 1.20
Tags

9 Update Logs

v2022-04-30 : by fafik77 04/30/2022 3:21:27 pmApr 30th, 2022

updated to support 1.18
LOAD MORE LOGS

Create an account or sign in to comment.

M4g1kz
05/13/2020 11:26 pm
Level 1 : New Miner
M4g1kz's Avatar
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 64 : High Grandmaster Miner
fafik77's Avatar
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
2
M4g1kz
05/14/2020 7:40 pm
Level 1 : New Miner
M4g1kz's Avatar
Thanks for this reply!
1
CraftMaster6875
05/10/2020 4:10 pm
Level 19 : Journeyman Crafter
CraftMaster6875's Avatar
what is this?
1
fafik77
05/01/2020 9:15 am
Level 64 : High Grandmaster Miner
fafik77's Avatar
so i don't know what happened with the text here, but it was fine right after publication
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome