Started by
JennaF64
on
Topic category: Help with modding (Java Edition)
Hello,
I'm currently making a mod that features a creature that causes an effect if it spots you.
The way I'm tackling this is via this procedure:
https://imgur.com/kVEXFF7
The only issue with this procedure is that as soon as I open the world, and the entity loads in, the game crashes. I assume this is because of the heavy performance that is required to run these code blocks.
The closest forum post is this one:
https://mcreator.net/forum/108222/help-how-check-if-there-block-between-entity-and-player
it doesn't crash due to performance, you need to check if an entity of type player exists in that square cube size first
Ah, I see.
I added that and it looks like it crashes the game when I (the player) gets near the area the entity is looking at.
There seems to be a lot of crashing when I use any of the raycast blocks but in this case I kind of have to use it.
alright, I figured out why it was still crashing. this is the right procedure: https://imgur.com/7gla9sd