#Predicate Based on Damage type for custom enchantments

1 messages · Page 1 of 1 (latest)

full wraith
#

I'm trying to create a custom enchantment datapack that protects against a specific damage type such as magic, or indirect magic, etc. However when looking through the documentation of predicates, the closest thing that I was able to see that I could call is a "damage_source_properties" condition which only lets you make a predicate with "Damage type tags" which group several damage types together (I think).

My question is, is it possible to call a specific damage type or types individually instead of using the tag groups? And how would I go about doing that?

I also might fundamentally misunderstand how this is working since I'm very new at this. Any help is appreciated, thanks!

fossil pantherBOT
#

<@&1201956957406109788>

Someone will come and help soon!

💬 While you wait, take this time to provide more context and details.

🙇 If nobody has answered you by <t:1749743604:t>, feel free to use the Summon Helpers button to ping our helper team.

✅ Once your question has been resolved (or you no longer need it), please click Resolve Question or run /resolve

tropic brook
#

You can make your own damage type tags

#

Which can of course just include a single damage type

full wraith
tropic brook
#

No tutorials needed really, it's very easy. You make a JSON file in data/<namespace>/tags/damage_type, and fill it with the list of values you want it to contain, like any other tag

full wraith
tropic brook
#

You don't want/need the {} bits inside the values list, you can just list each type as strings directly

full wraith
#

also would this be under minecraft/tags or would I need to put this under mpe and then add a tags folder, ah apologies I'm a bit tired lol

tropic brook
#

That syntax is for if you want an entry to be optional for the file to successfully validate, such as if there was a modded damage type you wanted it to be compatible with without requiring that mod for the pack to work otherwise

tropic brook
full wraith
#

ah ok

tropic brook
#

Generally you should only put things in the minecraft namespace if you're overwriting a vanilla file

full wraith
tropic brook
#

Looks right

full wraith
#

awesome, thank you so much! Never would've been able to find this through google haha