Check for Event on certain Position

Hey everyone,
Im new to the RPG Maker and Javascript and still have some problems here and there...

What I'm trying to do right now is to check if there is a Event with a certain name on a specified tile.

What I got so far is that I can use $gameMap.eventIdXy(x,y) to get the Id of an event on a certain position
and then get the name of this event with $dataMap.events[id].name.

So if I have multiple Events with the Nametag "Boulder" and one of them is on the specified position I can now check if thats
the case. My problem now is that If there is another event on the same position I only get the name of one of the events.
(I think it's always the one with the lower Event ID?)

How can I check if one of the Events is the one named "Boulder" as example?
Im thankfull for any help.

I've moved this thread to MV Support. Thank you.


Though, depending on what's needed, it might need to go into Javascript Support.
Try $gameMap.eventsXy(x, y).some(function(event) { return event.event().name == "Boulder"; })

event is the event object, which doesn't have a name property
event.event() is the $dataMap object which was used to create the event object. It has a name property.

If that gives you an error, post the error message from the console (F8 while playing, not the message that pops up on the game screen). It'll probably just be a syntax thing if there's anything wrong.
Hi, I have the same request but the code that you wrote, Shaz, is returning undefined.

I'm trying, through a game_characterbase funtion, to search for a event in various (x,y) positions and return true when it found one. In the case, I would like that the event was checked if it has a notetag specific name.

But until now I'm just trying to figure out how to do it... and the position need to be update depending of where is the actual event position ingame, that can change.

Original thread: https://forums.rpgmakerweb.com/threads/check-for-event-on-certain-position.82782/