Started by
xanadian
on
Topic category: Help with Minecraft modding (Java Edition)
Is there a procedure I can use to test if the entity that's affected by my mod is undead/anthropod/etc? For example:
Say I want to create a special arrow that affects undead differently than other types of mobs. How do I test for the entity type using procedures? Or will I have to create custom code to do that instead?
Thanks!
Check https://mcreator.net/tracker, there is a ticket for this, upvote it to show the support for this.
For now you will need custom code for this, but I do not have source at hand right now to show you how that would be done.
Well, I've dorked around with the forge api a bit..as long as I don't have to deal with obfuscated methods, I *might* be able to figure it out???
Thanks!
This seems to work quite well: https://pastebin.com/KhJWyYcG
Figured I'd share it for others if they want it. Note that people will need to import the net.minecraft.entity.EntityLivingBase package.
wait, no, when I tried exporting the mod, the compilation errored out. Worked fine in the test environment. Hmm... Guess I'll need to poke at it some more.
if you figure it out, let me know
Nevermind I found it. In entity data there is a "is event/target entity creature type:" and then a list of options including undead.