Lines of Lore:
Determines the number of lines of lore on an item
Code:
Usage:
Will return an integer value
Empty Slots:
Determines the number of empty slots for any given range of slots in a player's inventory
Code:
Usage:
This checks the whole inventory of the player
Set Slots:
Determines the number of set slots for any given range of slots in a player's inventory
Code:
Usage:
Simple Replacement:
Replaces specified blocks in given radius to any block
Code:
Usage:
Replaces all sand blocks in a radius 5 to Dirt
Determines the number of lines of lore on an item
Code:
code_language.skript:
function GetLoreSize(Item: item) :: integer :
set {_Lore::*} to lines of lore of {_Item} split at "||"
return size of {_Lore::*}
code_language.skript:
GetLoreSize(player's tool)
Empty Slots:
Determines the number of empty slots for any given range of slots in a player's inventory
Code:
code_language.skript:
function GetEmptySlots(player: player, num1: integer, num2: integer):: integer :
set {_EmptySlots} to 0
loop integers between {_num1} and {_num2}:
if slot loop-value of {_player}'s inventory is air:
add 1 to {_EmptySlots}
return {_EmptySlots}
code_language.skript:
GetEmptySlots(player, 0, 36)
Set Slots:
Determines the number of set slots for any given range of slots in a player's inventory
Code:
code_language.skript:
function GetSetSlots(player: player, num1: integer, num2: integer):: integer :
set {_SetSlots} to 0
loop integers between {_num1} and {_num2}:
if slot loop-value of {_player}'s inventory isn't air:
add 1 to {_SetSlots}
return {_SetSlots}
code_language.skript:
GetSetSlots(player, 0, 36)
Simple Replacement:
Replaces specified blocks in given radius to any block
Code:
code_language.skript:
Function Replace(Player: player, Radius: integer, Replace: block, With: block):
loop blocks in radius {_Radius} of {_Player}:
if loop-block = {_Replace}:
set loop-block to {_With}
code_language.skript:
Replace(player, 5, sand, dirt)
Last edited: