how do i make an effect check for the effected's tag and compare it to it's tag?

Started by MintyJuicey on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i make an effect check for the effected's tag and compare it to it's tag?

im currently making a mod and i want to make it so that a mob can devour you if your half health but also not do that when you have tamed it

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In the AI, where you're…
Sun, 04/07/2024 - 17:20

In the AI, where you're telling it to attack players, add a 'continue condition' that checks if the entity is tamed, and that the entity it's targeting to attack is at half health. (You would do this by checking if the victim's current health is less than or equal to their maximum health divided by two.)

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
that doesnt seem to work…
Sun, 04/07/2024 - 22:48

that doesnt seem to work with me well. i need an effect that does exactly in the title because i want this mob to work on mutiplayer so any ideas

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In that case you should be…
Mon, 04/08/2024 - 10:48

In that case you should be able to just check that the entity it's targeting for an attack does not equal the entity who tamed it. You can reference both using the 'get owner' and 'get entity targeted for attack' functions, and then also check that the entity targeted for attack is at half health, using the above method. Again, for this to do anything, it needs to be the continue condition for your entity's attack AI, so you need to make sure it returns 'true' if the conditions are met, and 'false' if they aren't.

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
any ideas???? guys?
Mon, 04/08/2024 - 11:45

any ideas???? guys?

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
hmmmm maybe i shouldn't do…
Mon, 04/08/2024 - 13:53

hmmmm maybe i shouldn't do that but like is there a way to detect if an entity has hit someone

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yes. You would use the …
Mon, 04/08/2024 - 18:41

Yes. You would use the 'entity attacked' global trigger. This will supply you with the even/target entity, (the entity that was hit), and the source entity. (The entity that performed the attack.)

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wait is there a plugin to…
Tue, 04/09/2024 - 13:14

wait is there a plugin to detect this

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
thanks a lot guys
Wed, 04/10/2024 - 14:55

thanks a lot guys

Joined Apr 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
wait how do i detect the…
Wed, 04/10/2024 - 15:37

wait how do i detect the target mob is a custom one?

Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You would use the 'is entity…
Wed, 04/10/2024 - 15:57

You would use the 'is entity subtype of' function, found in the logic box. You provide it with an entity, and it returns true if that entity is of the given type.