added check for custom elements being "next to" player or element