Created by eyzk

Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.

# Please do not delete these credits, unless you plan on fully overhauling this system.
# ---------------------------------------------------------
# Created by Eyzk - 08/15/2023
# Distrubution and modified usage allowed with credit
# Socials:
# ---------------------------------------------------------

	name: &fBackpack # The name for your backpack
	size: 1 # The amount of rows in your backpack
	perm: backpack.use # The required permission to use this backpack (delete if unwanted)

command backpack: # Opens the player's backpack
	permission: {@perm}
		set {_bp} to chest inventory with {@size} rows named "{@name}"
		loop {@size}*9 times:
			set slot (loop-value)-1 of {_bp} to {bp::%player's uuid%::%loop-value%}
		open {_bp} to player

on inventory close: # Sets the items within the backpack (this system can be improved)
	if event-inventory's name = "{@name}":
		loop {@size}*9 times:
			set {bp::%player's uuid%::%loop-value%} to slot (loop-value)-1 of event-inventory