Guide:Bases

A base can be loosely defined as an area that contains a player's NPCs, crafting stations, and storage chests, all housed together for convenience. It can be built as crudely or as lavishly as you see fit, as long as it contains those three essential elements.

In singleplayer, it is recommended to build your base near the world's original spawn point. This allows you to easily respawn or teleport to your base before you have access to Beds.

NPC Houses
A NPC house is an enclosed structure which NPCs will move in. As houses can share walls, floors, ceilings and doors, multiple NPC houses usually become rooms within a larger building.

NPCs might have trouble defending against enemies, so players will need to make sure that enemies cannot get at NPC houses. See "Base Defense" below for more details.

NPC houses can be built from any obtainable Blocks, as long as there are no more than 250 Corruption or Crimson blocks nearby. However, using grass blocks can bring in vines and other plants.

Bedroom
A base should also include a room containing a Bed in which the player will spawn in upon death or when using a Recall Potion, Magic Mirror, Ice Mirror, or Cell Phone. Note that the bed must be chosen as the player's spawn point, merely placing it will not make it work. This room can also double as an NPC house (the bed counts as a "comfort item"). Placing the Nurse here is a popular option, especially if you have an arena nearby; this allows a player to teleport home for healing or buff removal in the middle of a fight. The Merchant or another vendor NPC is another option.

Unlike regular NPC houses, it is important to be able to exit a bedroom once you spawn there -- especially if the Nurse is in there, you may need to quickly lure bosses away from her and your other vulnerable NPCs.

Crafting Area
A base should also include a crafting area in which the Player can craft items. This area should contain the most-used crafting stations like the Work Bench, Furnace, Anvil, Placed Bottle and Tinkerer's Workshop. Additionally, it's useful to assign the Guide to the crafting area, as this will allow the player to look up recipes for items.

Please note that putting all crafting stations together has the downside of forcing the player to scroll through every potential crafting option to find the one that they need. You can check the expanded table instead (by pressing the Hammer button in ).

Storage
As you gather loot from your adventures, you will eventually exceed your inventory capacity, which will require you to use Storage items like Chests. Using a variety of different containers can help you recall where you stored certain items, as can using decorative items, statues, signs, or renaming them. Usually, players put similar types of items into the same containers (for example: "Building Materials", "Crafting Ingredients", "Ammunition", "Potion Ingredients", "Ores and Gems"). Some players may even wish to organize their crafting area to provide some structure and place supplies near their matching crafting stations. It is best to avoid assigning NPCs to your main storage area, as you cannot right-click chests when NPCs are standing in front of them. However, some may rate nearby storage for their related items, notably the Dye Merchant, Painter, and Clothier.

Players may wish to organize their storage items the same way between all worlds so that they don't have to remember a new pattern for each one.

Putting all the containers near each other allows the player to use the "Quick Stack to Nearby Chests" feature to automatically put all items in the player's inventory into the chests where they belong. Marking your key items and supplies as "favorites" will avoid accidentally leaving them in your base before an expedition.

It may be useful to keep associated items in outposts near their biomes, e.g. make a base close to the Jungle, and store things you would get in the jungle in it. These outposts might include useful teleportation rooms, to quickly gain access to the biome from home and to that storage area.

I highly recommend building the storage area first as it is important in your base especially if you don't want to forget where you put your useful item. Also, make sure you don't trash something you thought was useless as it can sometimes help you in some instances.

Garden
A dedicated garden can keep the player supplied with a steady variety of Herbs for Potions. Nearby landscape can also be used to grow Trees or (later) Pumpkins.

Trees can be grown with a two block gap between acorns, so it helps to paint every third dirt block a different colour so you remember where to plant Acorns.

Roof Access
The player may consider adding access to the roof, usually to gather the that can fall on a large base, or for other reasons, like a Minecart Station or Skybridge.

Travel
Minecart Track can be used to make an easy and cheap way to get around your world quickly. Even for a Large world, less than two stacks of iron bars will make enough tracks to span the entire world (and the tracks can also be found and collected underground). If the tracks are laid atop platforms or blocks, the railroad can double as a sky bridge for collecting Fallen Stars. In versions, once reaching Hardmode you can also make sky bridges out of Conveyor Belts to automatically gather the stars that fell. A Hellevator with ropes or platforms can provide easy access to Caverns and the Underworld.

Once the player has reached Hardmode, a Teleporter network may be useful for players who need to get to far outposts quickly. Setting up the network is a fairly lengthy and expensive project, but can be done by stages as time and money allow. When setting up a central teleporter room, hoiks and other advanced techniques can allow a rapid choice of destinations, or a player can simply set up a linear path to run back and forth along with their world, with branches to reach underground and sky outposts.

Outposts
Outposts are small bases that are used as a staging area for exploration, farming, and fishing of the Biome they are built-in. Outposts usually contain basic facilities as well as means of transport between them, like a Teleporter system or a Railway. Once a player has progressed past a biome they may expand their outpost into a full base, and terraform the surrounding biome more to suit their needs better. It is also worthwhile to set up outposts at various depths, such as in the Jungle's Cavern layer.

Contents:
Most outposts should include at least the following parts.
 * Bedroom: This is a valid room containing a Bed. Whenever the player wants to farm a specific biome, they can set their spawn point using the bed so they do not need to travel back to the outpost when they die.
 * Storage area: Several chests to store local supplies and items gathered from the biome.
 * Crafting area: The outpost should include basic Crafting stations so the player doesn't need to return to their base to craft simple items. Most common here will be Work Benches, Furnaces and Anvils, but a Heavy Work Bench may come in handy, and the biome's crafting station is certainly appropriate.

Optional facilities include:
 * A Fishing spot: This allows fishing in a specific biome (and depth) without being bothered by enemies.  This involves a water pool of at least 300 blocks, which should at least be enclosed and lit, and optionally walled off against enemy spawns.
 * NPC Houses: These serve multiple purposes:
 * Spare rooms for new or dislocated NPCs
 * Reduce or eliminate enemy spawns in the vicinity.
 * Any vendor NPC can be used to sell off collected items.
 * Some NPCs will sell certain items only if they are housed in the appropriate biome. Especially the Witch Doctor sells several items from the Jungle, and the Painter has special paintings for most biomes.

Suggested outposts
These are some of the outposts that a player can make in their world, and a short description of why they would be useful. Several of these are specifically needed in Hardmode to farm Biome Keys for the Dungeon chests: Snow, Jungle, Hallow, and either Corruption or Crimson. In Hardmode, the latter three also contain Biome Mimics with rich drops.

A surface desert outpost can provide shelter during sandstorms, and allow easy gathering of Cactus (and Pink Prickly Pears), and occasional Antlion Mandibles, as well as farming of Palm Trees and collection of the occasional Scorpion. In Hardmode, also allows hunting for Forbidden Fragments, and the variant desert types can provide Dark and Light Shards. The local crafting station is the Glass Kiln.

The proper desert can also grant access to the Underground Desert biome. Here, the player can obtain Desert Fossils, and in Hardmode,.

Building an outpost on the surface allows the collection of Penguins for sale and farming of Boreal Trees. In Hardmode, the Ice Golem offers several drops, and there are more drops to farm underground, including Frozen Turtle Shells and the several drops of Ice Mimics. Fishing offers several useful rewards, notably (in Hardmode) the valuable Scaly Truffle (in an area that is also infected with Hallow or the evil biome). The local crafting station is the Ice Machine.

Furthermore, snow is not corruptible (although ice blocks are), so if a player seeks sanctuary from the Corruption or the Crimson, they can build in a snow biome.

An Ocean outpost is one of the more useful outposts, offering Shark Fins, Coral, Purple Mucos, Black Ink, Lime Kelp, and other items. Palm Trees can also be farmed here. The easiest method for an outpost is to simply build on the coast, dedicated players with good equipment can build an underwater base (see below). Fishing here rates a special mention for the number of valuable fish and items which can be caught. Only here can Duke Fishron be summoned and fought. In Hardmode, Pirate Maps are dropped here, and fighting an event here (including the Pirates themselves) can get several.

An outpost in the corruption allows the player to farm Vile Mushrooms and Rotten Chunks, as well as providing access to the Eater of Worlds, and Demon Altars. In Hardmode, the more important drops are underground; Cursed Flame s and Souls of Night are both crucial. To improve farming, players may wish to clear out an area underground and connect it to their base.

An outpost in the crimson allows the player to farm Vertebrae, Vicious Mushrooms, as well as providing access to summon the Brain of Cthulhu and Demon Altars. In Hardmode, this is where to find Ichor and Souls of Night. To improve farming, players may wish to clear out an area underground and connect it to their Crimson base. The crafting station is the Meat Grinder.

Farming Harpies for Feathers and Wyverns for Souls of Flight requires an accessible platform high in the sky. Players can use an existing Floating Island or just build their way up. An arena-style area with wooden platforms makes the fights easier, while a player-walled base provides a refuge from their spawning. Conveniently, most floating islands have a house containing a Skyware Chest, which can be used to shelter yourself from Harpies. If the walls are broken and replaced by the player, it will also prevent Wyvern spawns while inside. Fishing here can provide several unique catches, including Sky Crates providing any items missing from the chests. However, only the chests can provide the local crafting station, the Sky Mill.

Placing outposts in the Jungle at various depths helps with gathering and farming of various resources, and provides secure bases for exploration and storage of your loot. The vegetation provides Rich Mahogany, Moonglow and Sky Blue Flowers, along with critters for bait or Grub Soup. frogs are plentiful here, and sell fairly well. The underground enemies can provide Vines, Jungle Spores, and Stingers. Players may also gather several useful accessories in the jungle, notably the Bezoar and Nature's Gift. Fishing outposts should be set up at various depths, as the catches vary. Building a house for the Witch Doctor gives you access to items that he sells only here.

After defeating the Queen Bee, her hive can be used as another outpost, which not only provides honey but allows fishing for Honeyfins. She can also drop the local crafting station, the Honey Dispenser.

In Hardmode, even more drops and resources appear, notably Life Fruit and Chlorophyte Ore. Plantera's Bulbs and the Jungle Temple represent major boss fights, and having a safe house nearby can be quite handy.

These glowing blue areas are rare, but braving their deadly enemies allows you to collect Glowing Mushrooms for crafting and potions, along with Mushroom Grass Seeds to spread the unearthly glow elsewhere. The unique Glowing Snails can also be caught here. Creating an NPC House in a mushroom biome allows you to buy the seeds directly from the Dryad, but more importantly, allows Truffle to spawn in Hardmode. Creating a Surface Mushroom biome can let you bring Truffle somewhere more convenient, but the underground version is the only place to catch Truffle Worms.

An outpost near the Dungeon, and perhaps one next to one of its passageways can provide helpful staging areas for exploring and looting the area. Locked Gold Chests provide a variety of items, and if they prove insufficient, a fishing spot here can supplement them with Dungeon Crates. The enemies provide a variety of drops as well; Bones can be had in quantity, while the Nazar and Tally counte r are important for later crafts. In Hardmode, there are more drops, especially Ectoplasm. Two crafting stations come from here: The thematic Bone Welder and the useful Alchemy Station. The Bewitching Table can also be useful for summoners.

The Underworld has valuable resources not found elsewhere, notably Hellstone. Players often construct Hellevators to provide easy access to the Underworld, and one of the Ruined Houses can easily be spawn-proofed by breaking and replacing its walls. Several enemy drops are useful, but in particular, the Voodoo Demon provides a Guide Voodoo Doll used for summoning the Wall of Flesh. After defeating that boss for the first time, Hardmode begins, and afterward Living Fire Blocks can drop from any enemy. Farming the Wall of Flesh can provide many useful items, especially Emblems used for crafting. The Ruined Houses provide the Hellforge, which is not only the local crafting station but a component of the Hardmode Forges. The Shadow Chests provide a variety of other powerful items.

When Hardmode begins, one of your existing outposts may well find itself in the Hallow, but if not you can easily set one up. Enemies here provide Pixie Dust and Unicorn Horns for crafting, plus other drops for use or sale. A large, flat area is best for gathering these. The Underground Hallow can provide Crystal Shards (excellent for cash farming) and Souls of Light, along with various other enemy drops. (Hallowed Mimics rate special mention.) Several long, straight tunnels make gathering Crystal Shards quicker.

Base Defense
Player-made structures don't come with protection against enemies. Having monsters wandering around plant farms may be no big deal but many would prefer their NPC areas to be protected. If you already built a base on the ground, and don't want to move, move your chest room within your town of NPCs, this will prevent monster spawns. Place Peace Candles around your house if it is large to minimize spawns. In a Normal mode world, the presence of NPCs will itself suppress ordinary spawning of enemies; each NPC on-screen will reduce the spawn rate, and 3 NPCs on-screen will completely suppress enemy spawns, even at night or when Raining.

However, Events are another story: While on most platforms NPCs can defend themselves, individuals can easily be overwhelmed by even Blood Moon enemies, especially in Hardmode. In Expert mode, even ordinary night spawns can be an issue. Once the Mechanic is rescued, actuated blocks can be used to block off entrances and uncover lava pits during events, then switched back to normal afterward.

General points

 * By far the easiest way to defend your NPCs is to build a floating base above the ground, with Ropes or flight as the only means of access. This will not prevent NPCs from living at your base, as they can teleport to houses they cannot otherwise reach (while offscreen). Structures do not need to rest on surfaces unless built from the few materials that obey gravity (sand, silt, and slush).   Once built, the terrain surrounding the base can be dug out to create a moat around it, preventing easy access to most monsters.
 * This is the only way to defend your base against enemies that can pass through walls, such as Wraiths. Wraiths can move upwards while passing through blocks, but cannot float upwards through empty tiles.
 * Flying enemies like Demon Eyes can still reach floating bases, but cannot open Doors. They are not a threat if your base is sealed off.


 * Enemies cannot break open doors if they are unable to stand in front of them. Elevating a door at least two blocks above the ground will grant absolute protection against enemies that can open doors.
 * You may additionally guard the entrance with a pit to trap enemies, though your NPCs may also fall in.  See "Offensive Traps" below for details on using lava to automatically kill enemies that fall into your pit(s).
 * Enemies also cannot force open doors if a piece of furniture, like a Chest or platform, is directly against the inside of the door. Players will have to face away from the house to open the door from the outside.


 * You can place platforms in the floor or ceiling of an NPC house, or your base, instead of using Doors. This will stop NPCs from moving outside their houses and endangering themselves. However, flying enemies can pass through such platforms, and some enemies can jump or fall through.   A layer of actuated blocks can be used to seal off your base for events.


 * Every base should have at least some chests, which will prevent Meteorites from falling within 35 blocks of them. Meteorites also will not fall within 35 blocks of an NPC, nor on-screen for any player..  See the Meteorite page for more details on protecting areas from Meteorites.
 * Once the Mechanic is present, you can use actuators (or active stone) and appropriate Pressure Plates, to create a player only door that doesn't require the use of the mouse. Simply actuate a section of wall and link it to some type of pressure plate that can only be triggered by the player, so that enemies are unable to enter, and NPCs cannot escape. You can also add defenses using traps as discussed below.   Once you reach Hardmode, a Sensor can let the player pass through such doors without even having to step on a pressure plate.

Offensive traps
Generally, placing lava and wired traps near the area where your NPCs are housed is risky, but can be effective if the NPCs are well-contained. Offensive traps can provide a bit of aid during invasions, but generally, the best practice in the event of an invasion is to fight somewhere other than your base. Nevertheless, the following tips may be useful if you want to set up a structure that can automatically kill enemies with little to no danger to yourself.

Lava Pits

 * Pits can be lined with a thin layer of lava to quickly kill most enemies.
 * Lava pits should be covered over with actuated blocks to make them safe for normal passage; they can be quickly "switched on" for an invasion or other events, and switched off afterward.
 * Players will normally want a tunnel beneath the lava pit, to safely collect drops from the slain enemies.
 * Lava will not destroy valuable items of any Rarity higher than white.
 * Lava destroys items only if they are submerged to higher than the midpoint of their sprite, so a thin layer will not destroy larger items. Note that the sprites for coins are progressively larger for higher denominations; if you want to collect coins along with other drops, you should fine-tune the depth of your lava to destroy copper coins, but not silver or higher.   In practice, this translates to one bucket of lava per 6 to 8 blocks of pit length.
 * The reason for letting copper coins burn, is that there is a global limit of 400 loose items in each world. If this limit is exceeded, the oldest loose items in the world will despawn, with no consideration for their value or rarity.  Stacks count as a single item, but even so, copper coins are dropped in such numbers that most events can easily reach the limit.

Other Traps
Note that Spikes and Hellstone can only damage players, not monsters. However, after rescuing the Mechanic from the Dungeon, you can wire traps to deal damage in more versatile ways:


 * A very simple mechanism is a buried Geyser wired to a single Pressure Plate.
 * Dart Traps can be wired to a Timer to fire continuously without further input.
 * Fire rate can be staggered by using a "rainstick" mechanism, as shown to the side. The mechanism is activated by manually falling through the platforms with the pressure plates on them. Note that the Traps must be moved into the background with Actuators, and the Actuators must be removed after doing so. 28 Dart Traps are required for continuous fire if the rainstick is set up in a Γ shape, and 21 if set up in an L shape (as shown).
 * Super Dart Traps, Spear Traps, and Flame Traps can replace the Dart Traps in the above mechanism once you have access to the Jungle Temple. Use a hammer to rotate them as you see fit.
 * Spiky Ball Traps are the easiest to set up; they need only be attached to a 1 Second Timer to work. Dropping the Spiky balls from a great height is not necessarily advantageous, as you want to maximize the time the balls spend bouncing near the ground to damage groups of enemies. Instead, embed the traps in the ground and hammer them twice so they roll out the spiky balls more gently.

Multiplayer Security
It is a sad truth of Terraria that nothing you do in-game will prevent a hostile player from damaging or destroying your base if they have the means to do so. No base can ever be completely safe, even from a griefer armed with only a Copper Pickaxe and some Wood. The following realistic tips can help protect your base by reducing your likelihood of encountering a griefer or reverting the damage that they might cause.
 * Only play with people that you trust, or have known for a long time.
 * Otherwise, if hosting, save a backup copy of your world and character files, so you can restore them to their previous versions if something unexpected happens.
 * Another method for hosts is to turn Autosave off, and if your base is damaged, exit Terraria directly by closing the window. All progress since the world was last loaded will be lost, but the damage will also be reverted.
 * If you are playing on a public server, you may be able to protect your structures using the server's built-in TShock commands. Most populated public servers run TShock.

Appearance
While your initial houses might be simple boxes of dirt or wood, over time you can do much better than that, producing a base that is not only functional but interesting to look at. You will be gathering a variety of materials and items over time, and one of your NPCs (the Painter) is specifically devoted to improving the appearance of your builds. Terraria is a sandbox offering vast opportunities for creativity. Over time, you can reshape your bases and create varied structures, ranging from elegant simplicity to intricate complexity, realistic to fantastic, and from the beautiful to the terrifying or hideous. Several periods of the game are particularly good for such work:
 * Late pre-Hardmode is an excellent time to work on your base, as you have no incoming threats or time limits in play.
 * After defeating the first Mechanical Boss, the Steampunker will arrive, offering some useful items that can add capabilities to your base, notably Teleporters, Sensors, and Conveyor Belts.
 * After defeating Plantera you will have a relatively quiet period where biome spread is less of a problem, and the last of your NPCs will have arrived (except perhaps Santa Claus).
 * And of course, after defeating the Moon Lord you will be master of your world, with access to all possible materials (except perhaps for the alternate evil biome).

General suggestions
Here are some suggestions and ideas for elaborating your base:
 * Don't limit yourself to rectangles! With hammered blocks, you can make a variety of forms, from symmetrical circles and triangles to asymmetrical complexities and sprawling organic blobs.
 * Remember that paint is cheap -- if you like the pattern or texture of something(be it a block, wall, or piece of furniture) but it's the wrong color for your build, change the color!
 * Likewise, torches come in a variety of colors and brightnesses (in Hardmode, there's even a rainbow torch), and gemspark and living fire blocks add more flexibility. Even campfires can be made in several colors, and some furniture lighting offers subtler variations.    Glass panes can provide natural light, and stained glass can modify it.
 * There are some special considerations for what blocks to use in your base:
 * Use of bare dirt blocks may result in the occasional Blinkroot plant spawning atop them, and nearby grass can spread onto the dirt. This also applies to mud in the jungle biome.
 * Grass will spawn "tall grass" plants on it.  Jungle grass will also spawn larger jungle plants, and perhaps Mahogany Trees.  Either may also spawn herbs or dye plants according to the biome.
 * If grass blocks are exposed from below (such as a roof/ceiling) they will also grow vines beneath them, which may be unsightly. Putting blocks or platforms beneath a grass layer will prevent vine growth.
 * Using Snow or Ice blocks can cause snowflakes to fall nearby. This is a purely visual effect.
 * Sand requires support, and even with that support, it makes building and rearranging things difficult. Sand blocks can also grow cactus, and occasionally spawn desert enemies such as Vultures.
 * Stone, grass, ice, and sand or sandstone are also vulnerable to being transmuted by infectious biomes. All of these except grass have brick forms which are not vulnerable.
 * Some simple decorations can quickly turn any NPC house into one that fits their theme or challenges it. For example add some Plants and a Flower Wall to the house of your Dryad, some Bottles and a Bed for your Nurse, a Crystal Ball for your Wizard, an Ammo Box for your Arms Dealer, or some Christmas decoration for Santa Claus. All NPCs have some items that suit their theme, allowing you to build some nice houses for all.  Or you can go for contrast, sticking them in a room that they'd presumably hate with a burning passion, say flowers and bright colors for the Tax Collector, or a bare stone cell for the Dye Trader... malicious housing can be fun!

Particular Structures
And some ideas for additional structures, either as part of your base, outposts, or just built for fun:


 * Castles: One of the most popular constructions in Terraria is a castle. Of course, you can build a simple symmetric castle, but this tends to look rather boring. A good way to build a more interesting castle is by building some tower tops of varying sized and varying heights, and then connecting them. For colors, the Gray Bricks and Red Bricks combine well, while some more expensive bricks may look good for the throne room. Use your imagination to build the way you like it.
 * Mines: Not only is it handy to have direct access to a large mine but it looks great too. Using some Wooden Beams, Planked Walls and torches you can make simple and good-looking mines for yourself.
 * Tree House: You can either build your treehouse or edit a Living Tree. Make sure to use some more natural blocks and walls to make it look better.
 * Outposts: Since you'll be building some outposts and secondary bases anyway, you can decorate them in the style of their biome or some contrasting style.
 * Arenas: Likewise, there's no reason a boss arena can't also look good.
 * Themed Houses: There are many furniture themes in Terraria. For example, take a look at the different Doors that are available. You can make a house (or other structure) for each of those themes.
 * Pyramid: Make a giant above-ground pyramid, half maze and half trapped to make a worthy burial chamber.
 * Domes: Build large glass domes (or other shapes) to display your work.
 * Treasure Chamber: You may not have noticed yet, but you can place Coins, Bars and Gems. This can be used to make a great looking treasure chamber.
 * Atlantis: You can build cities everywhere... why not underwater?  See below for more details.
 * Sky Tower: Build a tower reaching into space, or remodel a floating island. Watch out for Harpies and Wyverns!
 * Museum: There are many items to display in Terraria. For example you can make rooms to display Statues, Paintings, Trophies, Armors, Banners, Butterflies, Critters, and Weapons.
 * Pixel Art: Using different colored blocks, you can make images inside your world. Gemspark Blocks and their walls make good illumination,  especially if you want your creation to be visible in the dark or underwater.
 * Church/Temple: Make a place of worship for the faithful... be they a congregation seeking holy worship, or depraved cultists gathering for dark rituals.
 * Zoo: Statues can let you keep various Critters and even enemies on display.

Underwater bases
Building underwater is fairly difficult, as you tend to drown, you move slow underwater and it's dark. Normally you will want to drain the water out of your building as well. You will also need a way to easily enter and leave your house. Luckily there are solutions to all those problems (see the Liquids page for more tips):


 * For building underwater, you can use Gills Potion or a Neptune's Shell, allowing you to breathe underwater. Lacking those, you can work in short bursts with a Jellyfish Necklace.  Or you can start with a valley, or an area you've already drained as below, build in comfort, and then flood the area outside your base.
 * For light underwater, you can use a Light Pet, Cursed/Ichor Torches, Gemspark Blocks, or one of those few lighting items which do work underwater.
 * To drain the water from an area, there are several options:
 * You can use pumps or a stack of buckets to take it elsewhere.
 * in Hardmode, you can deploy the Super Absorbant Sponge.
 * The "chest trick" works as follows: Prepare a dry 2x2 hole at the bottom of the pool, surrounded solid blocks.  Put 3 or 4 buckets of honey or lava in over the chest, then mine the top to let the water in.  Since there is no place to put the obsidian or honey block, the water will simply be destroyed.
 * To get in without flooding your house, you can make an entrance from below, (platforms can be useful), or in Hardmode you can use a wall of Bubble blocks.
 * You can even build a true underwater base, lit with waterproof methods, to be inhabited with the aid of a Neptune's Shell. (Note that NPCs will not accept a flooded house!)