Code:
var trapEvents = $gameMap.events().filter(function(event) { return event.event().name === 'trap'; });
var monster = $gameMap.event(this.eventId());
trapEvents.forEach(function(trap) {
if (monster.x < trap.x + 1 && monster.x > trap.x - 1 && monster.y < trap.y + 1 && monster.y > trap.y - 1) {
$gameVariables.setValue(13, 1);
}
});I put variable 13 so it's easy to check. But when the monster event is next to events named trap, nothing changes.