Can I stop mobs from walking into my house... without a door?

Solution 1:

I've tried a lot just to get this to work, but pathfinding is different in BE, meaning some things that would normally work in JE (like the carpet trick) wouldn't work Here's a slightly different approach that might tickle your fancy. Interesting idea ExpertCoder14! Walking into your base, you have a line of open trapdoors in the floor with a lava pit underneath. Try building the setup below, then try to get inside without jumping or sprinting.

If you test it a few times, you'll find out that just by holding down your forward key, you can make it across just by walking! No sprinting, no jumping. Just hold W and go.

As long as you don't stop in the middle of the crossing, you should be just fine. Mobs are too slow to make it through! So they fall and die in the lava.

You can walk in at angles of up to 45 degrees. Anything more and it heightens the risk of falling in.

I suggest, instead of creating just a lava pit, you can funnel mobs into a custom-built mob grinder so you can get their experience. This also helps because you can implement a minecart system that allows players to safely escape the funnel without falling in with the mobs.

Downsides

  • Slimes: Slimes are so big, they won't fit in the pitfall trap!
  • Witches: They drink potions to self-heal. Depending on your mob grinder method, they might take a while to die!

Solution 2:

Railway. Mobs won't go onto railway unless pushed, by them or others. Looks like some of the old methods no longer work in newer versions. Or a honey block moat. Non leathal and you can jump over it.