Monoliths are part of the Dimensional Doors mod. They are large, narrow black rectangles that float around Pocket Dimensions and Limbo. They cannot move, but will turn to face the player when you get near. They were implemented to keep the player from pillaring outside of dungeons in order to bypass certain traps.
These Monoliths will teleport you to Limbo if you look at them long enough or get too close. Their animation consists of a closed eye fading into existence, then opening suddenly and expanding until you appear in Limbo. There is a noticeable sound growing in intensity to warn you of the impending teleport. You can avoid being teleported by staying away from Monoliths, and quickly moving out of range if you attract the attention of one. It should also be noted that a Monolith will not teleport you if it does not have a direct line of sight, meaning the player will not be teleported if they hide behind some sort of wall, despite the Monoliths making their notable sounds.
Monoliths are also prevalent in Limbo itself. In fact, they are so densely packed that it is difficult to find a spot where you are not in danger of drawing the attention of a nearby Monolith. When you are in Limbo, the Monoliths will teleport the player to a random location in Limbo.
Monoliths are relatively easy to avoid. Staying in the bounds of the dungeons found in doors is usually the best option. However, there may be an occurrence when there is a zone that is open to the air, meaning Monoliths can and will spawn. The best thing to do here is usually just to avoid the area entirely.
Attacking a Monolith through conventional means will cause it to teleport you to another randomized location inside of Limbo. Explosives, however, can allegedly "kill" them. Specifically, if you shoot one just right with a Hunter's Handgun using Buster Bullets (Explosive Rounds), you may be able to make a monolith disappear. This method can be extremely hard to use but is currently the only known way of getting rid of Monoliths.
An alternative is shooting it with a Water Staff as it will make it bubble up and away. Once it reaches any block above it, it will disappear completely. If there is no ceiling, this method will not work.
Some Monoliths can be removed in creative just by passing them or by pushing them away from the pocket dungeon. This works because Monoliths do not typically move away from its current location. If you have enough patience, you can use blocks and TNT to clear the dungeon from Monoliths, making it safe.