select entity type by registry name (or simulate command chains)? [SOLVED]

Started by nl_nl_n on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
select entity type by registry name (or simulate command chains)? [SOLVED]
Tue, 09/03/2024 - 12:48 (edited)

I want to make a stuff tracker, but one that works with entities from external mods. Is there a way to do something like what I put in the image?

https://i.postimg.cc/3wZqqvzc/awdawda.png

(edit) If this is not possible:

It's actually something I could do with command blocks, using /execute things.
Is there any way to simulate command block chains?

Something like:

CommBlock 1 - repeat - unconditional: execute if entity @e[type=supercreepers:sand_creeper]

CommBlock 2 - chain - conditional: execute as @e (etc)

CommBlock 3 - chain - unconditional: execute as @e (etc)

While I could hide command blocks in the worldspawn in y=-64, covered by bedrock, it would stop working if for some reason I changed the worldspawn.

PS: I put the name of a random mod that I don't know if it even exists, but it could be one of mowzie's mobs, MCA, etc.

Edited by nl_nl_n on Tue, 09/03/2024 - 12:48
Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I've found out how. It turns…
Tue, 09/03/2024 - 12:00

I've found out how. It turns out there's a universal entity iterator, so I put a text variable with the name of the mob to track and compared it to the entity evaluated by the iteration.
Then a bit of trigonometry to see which entity was the closest. I was only interested in the distance in the XZ plane, if you want the 3D distance you have to add the squared term of the difference in Y.

I checked that it works with mod entities as well before making this auto-reply.

 

https://i.imgur.com/J7e71tn.png

 

https://i.imgur.com/GEtWoiU.gif