Is there a way to check if an entity is on/inside a specific block?

Started by xavier23 on

Topic category: Help with modding (Java Edition)

Last seen on 23:21, 21. Apr 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there a way to check if an entity is on/inside a specific block?

Hello there! I am currently working on a Frozen Zombie in my Minecraft mod, and I was just curious if there was any way to make an entity transform into another if it was on a specific block for a long period of time, similar to when a Skeleton transforms into a Stray if it is in powder snow. For instance, I was aiming to make Zombies transform into this new type of Zombie if it was in/on a block such as powder snow for about 30 seconds. Thank you for your help; have a great day!

Last seen on 03:15, 26. Apr 2024
Joined Aug 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
on loaded entity tick update…
Sun, 02/18/2024 - 00:56

on loaded entity tick update

if block exists at x y z

wait 30 seconds

check if entity is still on block

if so, kill the entity, and spawn the new one

as for INSIDE, thats more complicated