Testing for undead in procedures?

Started by xanadian on Mon, 04/06/2020 - 00:41

Topic category: Help with modding (Java Edition)

Last seen on 13:41, 13. Mar 2021
Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Testing for undead in procedures?
Mon, 04/06/2020 - 00:41

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…
Mon, 04/06/2020 - 06:53

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.

Last seen on 13:41, 13. Mar 2021
Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Well, I've dorked around…
Tue, 04/07/2020 - 21:57

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!

Last seen on 13:41, 13. Mar 2021
Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
This seems to work quite…
Thu, 04/09/2020 - 18:58

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.

Last seen on 13:41, 13. Mar 2021
Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
wait, no, when I tried…
Thu, 04/09/2020 - 19:52

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.