- check_circle Functions
- check_circle Loot Tables
Published Dec 25th, 2022, 12/25/22 4:04 pm
- 6,933 views, 15 today
- 1,727 downloads, 1 today
178
This datapack allows you to mine spawners with any pickaxe with silk touch enchantment
Click here for more of my submissions: www.planetminecraft.com/member/plomek/submissions
Click here for more of my submissions: www.planetminecraft.com/member/plomek/submissions
Compatibility | Minecraft 1.18 |
to | Minecraft 1.19 |
Tags |
1 Update Logs
Update #1 : by Plomek 12/26/2022 8:24:55 amDec 26th, 2022
- Fixed the datapack not working becouse I put it in a extra folder.
- Fixed a problem where the spawner didn't have any mob data written to it when you mined it
- Fixed a problem where the spawner didn't have any mob data written to it when you mined it
tools/tracking
5807034
119
silk-touch-spawners-5807034
Create an account or sign in to comment.
So first, as placing a spawner in survival doesn't keep its data, you can just store all of its data in a special tag in the dropped item. So just use :
{
in the loot_table. With this, all of the spawner data is stored in the dropped item tag SpawnData."source": "{}",
"target": "SpawnerData",
"op": "replace"
}
Then you want to detect when the player places a spawner. This can be easily achieved with a placed_block advancement.
In the reward function, store the SpawnerData tag of the held item in a storage and start a raycast function. Once you get to the spawner, simply do
data modify block ~ ~ ~ {} merge from storage <> SpawnerData
And that's all !Oh there is something else, you should make so only pickaxes can "harvest" spawners because for now, any item with silk touch can do it.
This can bring your datapack to only ~8 commands and 5 files.