This data pack was created to allow Villagers to harvest crops, and Snow Golems to place snow layers, while also retaining the desirable features of gamerule mobGriefing = false. Note that this data pack sets the mobGriefing gamerule to true.
This data pack disables block destruction done by the following hostile mobs;
This data pack also prevents the following hostile mobs from picking up items;
- Zombie Pigman
- Zombie Villager
Other hostile mobs that destroy blocks, such as the Wither Boss (and its flying skulls), and Ender Dragon do not have their explosion or block destruction abilities stored in their entity data, so they cannot (currently) have their griefing disabled via data pack in a way that does not have other undesirable effects.
More information about data packs and how to use them can be found on the official Minecraft Wiki.