- Supported Skript Version
- 2.8
- Supported Minecraft Versions
- 1.20
A very simple Skript that addresses a single issue: not being able to retrieve the same blocks that were placed!
Now placing a block or a head saves the original item for the drop when it is broken by a player or an explosion!
This Skript will be improved in the future to add more control and features. But for now, it does the job well.
Code:
- SkNBTPreserverGetItemFromBlock(block)
Returns the original item from a block
Example: drop SkNBTPreserverGetItemFromBlock(event-block)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SkNBTPreserverGetItemFromLocation(location)
Same as the function above, but from a location
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SkNBTPreserverGetNameFromBlock(block)
Get the name of a block
Example: send SkNBTPreserverGetNameFromBlock(event-block)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SkNBTPreserverSaveBlock(item, block)
Save a block in database. 'item' is the block as an item in your inventory.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SkNBTRegisterMoreData(block, data, value)
Lets you register more data on a block. Value is always a string.
Exaple: SkNBTRegisterMoreData(event-block, "cool-variable", "cool-value")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SkNBTPreserverRemoveBlockNaturally(block)
Removes a block from database and drops it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SkNBTPreserverRemoveBlock(block)
Removes a block from database without dropping it
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- kNBTRemoveAllBlocksByName(string)
Removes ALL blocks by name, without dropping anything
YAML:
/sknbtpreserver help (Main command)
- Aliases: /sknbtp, /sknbt
- Permission: sknbtpreserver.admin
/sknbtpreserver check
- Prints all registered blocks
/sknbtpreserver purge
- Checks database and removes useless data
/sknbtpreserver search <value>
- Searches all blocks by their name or the player who place dit
- /sknbtp search p:Palgia will search all blocks placed by Palgia
- /sknbtp search n:&aCool block will search all blocks named "Cool block"
/sknbtpreserver removeall <name>
- Removes all blocks by name in all worlds