- Supported Skript Version
- 2.8
- Supported Minecraft Versions
- 1.20
Create custom loot tables and loot chest !
Addons required: SkBee, Skript-reflect, Skript-yaml
➡ Create loot tables with items, variables, and items from SkItemCreator
➡ Create loot chest with global loot or individual loot
➡ Commands & Full API
➡ Particles & more!
Here's an example of a loot configuration
Code:
#Display name (for inventories, lore etc.)
display-name: "&8Example loot"
#If opening this loot needs a permission, use this
#permission: example.loot
#Max items this loot can give in global
max-items: 10
#Minimum items this loot can give in global
min-items: 1
#Cooldown
cooldown: 30 minutes
#Write true if the cooldown is global. Write false if the cooldown is applied to players individually.
global-cooldown: false
#Show particles around blocks that are linked to this loottable
#Particles will only show to players who haven't opened the chest.
#If the chest is global, the particles will show if no one has
#opened it
particles: crit
#Loot table
loots:
#Category named 'common'. You can create as many categories as you want.
common:
#Chance to give a loot from this category. From 0 to 100.
chance: 100
#Max items this category can give
max-items: 3
#Items
items:
- "GOLD_INGOT" #One gold ingot
- "EMERALD=5" #5 emeralds
- "IRON_INGOT=1~10" #Random amount of iron ingot, between 1 and 10
#Item from variable {myitem.variable} with fixed amount of 5
- "VAR=myitem.variable=5"
#Item from variable {myitem.variable2} with a random amount from 5 to 10
- "VAR=myitem.variable2=5~10"
#If you use my skript SkItemCreator, you can use an item from its dabatase
- "ITEMCREATOR=demon_sword"
rare:
chance: 50
max-items: 1
items:
- "NETHER_STAR"
- "DIAMOND_BLOCK=1~4"
legendary:
chance: 100
max-items: 1
items:
- "BEACON"
#You can execute commands. Use {p} has a placeholder for the player
commands:
- eco give {p} 1000
- msg {p} Hey !
skript:
chance: 100
#You can parse skript code
parse:
- broadcast "&e&l%name of player% got the loot!"
Code:
Main command: /skloot
- Permission: skloot.admin
Commands:
- /skloot help <page>
> Prints all commands
- /skloot get <loot>
> Give yourself a loot table
- /skloot give <loot> <player>
> Give a loot table to a player
- /skloot link <loot>
> Linkt the targeted block with a loot table
- /skloot unlink
> Unlink the targeted block
- /skloot setglobal <true/false>
> Set the targeted block as global or not.
A global chest can be opened by all players. Its loot will
be placed in the block's inventory, meaning the first player
to empty the chest will be the first to get the loot.
A non-global chest will give loots for everyone.
- /skloot setcooldown <seconds>
> Set a cooldown for the targeted chest. If the cooldown is equal
to 0, the chest can be opened only one time. If set above 0, the
chest will regenerate at the end of the cooldown (if the chest is
non-global, each player will have its own cooldown).
- /skloot destroy <true/false>
> Removes the block when opened by a player, dropping everything
on the ground. Only works if chest is global and cooldown is equal
to 0.
- /skloot search <radius>
> Searches for linked blocks in the given radius, placing a
bedrock block above them.
- /skloot unlock
> Unlock the targeted block, removing all current cooldowns, making the
block openable by players.
- /skloot chestinfo
> Prints information about the targeted linked block.
Code:
All functions here:
- SkLootLoadConfig(file):
- Loas a specific file or everything
if file is "ALL"
- SkLootReturnLoot(loot, bypasscooldown)
- Returns a list containing the loot
from the loot table. Use the function
below to execute commands and skript code.
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootReturnLootByPlayer(player, loot, bypasscooldown)
- Returns a list containing the loot from the given
loot table. Commands and skript code will be executed
for the player.
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootSetLootInBlock(block, loot, bypasscooldown)
- Places the loot table in the given block if
it has an inventory (chest, barrel, etc.)
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootSetLootInBlockFromPlayer(player, block, loot, bypasscooldown)
- Same as above but will take the player in account
in order to execute skript code and commands
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootOpenInventoryWithLoot(player, loot, bypasscooldown)
- Opens an inventory with the loot table. The inventory
is individual, it means that only the given player
can see it.
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootGiveLootToPlayer(player, loot, bypasscooldown)
- Gives the loot table to the given player
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootDropLootAtLocation(player, location, loot, bypasscooldown)
- Drops the loot table at the given location
- Replace 'bypasscooldown' by true
or false. Set to true to bypass
the loot table cooldown.
- SkLootLinkBlockAtLocation(location, loot, chestcooldown, override, globalloot, destroy)
- Links the chest at the given location with the specified loot
- Replace 'chestcooldown' by a timespan. 0 seconds will make the
chest openable only one time.
- Replace 'override' by true or false. True will erase the data
of the linked block at the given location if there was one.
- Replace 'globalloot' by true or false. True will place the loot
in the block's inventory. False will open an inventory to each
player who opens the chest.
- Replace 'destroy' by true or false. True will destroy the block and
drops the loot on the ground.
- SkLootUnlinkBlockAtLocation(location)
- Unlinks the block at the given location, erasing all data
- SkLootUnlockBlockAtLocation(location)
- Unlocks the linked block at the given location, removing
all current cooldows.