Check if entity is near/exist within specific block?

Started by Red-Eyed_Fairace on

Topic category: Help with modding (Java Edition)

Last seen on 06:15, 11. Jul 2022
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Check if entity is near/exist within specific block?

I know there's a procedure that checks if an entity is near or exist. 

But is it possible to make it check to block instead of another Entity?

Currently for my titans mod, I've made them have custom spawning condition, it does work, they spawn only on day when not raining but custom spawning conditions like that bypasses mod like "no Hostile around campfire". I know how to check for a block, but is it possible to combine the two in that way they wont spawn near campifre?

Currently I use ItemFrame as an alternative to prevent titans spawning inside my walled City (It's classified as entity on Mcreator somehow, same goes for ArmorStand)
ItemFrame

I dont mind editing the code itself if procedures dont work for it if anyone has any idea.