Minecraft Data Packs / Other

Silk touch spawners

  • check_circle Functions
  • check_circle Loot Tables
  • 6,933 views, 15 today
  • 1,727 downloads, 1 today
  • 12
  • 14
  • 3
Plomek's Avatar Plomek
Level 69 : High Grandmaster Pig
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
CompatibilityMinecraft 1.18
toMinecraft 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

Create an account or sign in to comment.

2
12/26/2022 6:50 am
Level 39 : Artisan Miner
Lordphenex
Lordphenex's Avatar
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
12/26/2022 8:28 amhistory
Level 69 : High Grandmaster Pig
Plomek
Plomek's Avatar
Thanks for your amazing help, maybe later I will implement these changes :)
2
12/25/2022 6:42 pm
Level 40 : Master Miner
Fabianox
Fabianox's Avatar
Doesn't work man
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome