Data Packs Other

Silk touch spawners

  • 8.4k views 1 today
  • save_alt 1.9k downloads
Compatibility
Minecraft 1.18
to version
Minecraft 1.19
Changes include
  • Functions
  • Loot Tables
  • 13
  • 15
  • 3
Plomek
Lvl 76Legendary Pig
312
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

1 Update Logs

Update #1 : by Plomek 12/26/2022 8:24:55 amDecember 26, 2022 @ 1:24 pm UTC

- 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

More like this

  Have something to say?

Lordphenex
12/26/2022 6:50 am
Level 44 : Master Miner
Your idea is great but there are ways to make your datapack much more efficient.
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 :
{
  "source": "{}",
  "target": "SpawnerData",
  "op": "replace"
}
in the loot_table. With this, all of the spawner data is stored in the dropped item tag SpawnData.
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 <> SpawnerDataAnd 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.
2
Plomek
12/26/2022 8:28 am
Level 76 : Legendary Pig
history
Thanks for your amazing help, maybe later I will implement these changes :)
2
Fabianox
12/25/2022 6:42 pm
Level 44 : Master Miner
Doesn't work man
2

Welcome