It sounds like you didn't understand me actually
"Of course you can notice a creature before an action declaration is made that will start combat." Agreed and is what I said.
"When combat starts both sides are revealed as threats to one another, but those creatures might have been noticed before the commencement of hostilities." This is also what I said.
What you don't seem to be understanding is where surprise comes in. Surprise happens when you fail to notice a threat. According to what you just said, you can't notice a threat until combat starts, which means both sides are automatically always surprised.
Again, you're misunderstanding me if that's what you think I said. That actually contradicts both of my statements you just quoted and with which you agreed. I think what you're talking about is that surprise is
determined at the start of combat. Once an action is declared that requires in-combat resolution, the first thing the DM needs to do is determine if any of the participants have not noticed at least one of the participants on the other side. The actual noticing may have happened some time before that. I hope that clears things up for you.
According to RAW, you can notice threats before combat starts AND before any threatening action occurs. Initiative happens AFTER surprise is determined. The order of things is
1. Determine Surprise
2. Establish Positions
3. Roll Initiative.
For the above to be true, you must be noticing potential threats, because two groups wandering into each other are not engaging in any active threatening. For those two groups to be able to surprise one another, they have to reacting to the potential threat of the other side. If neither side is being stealthy, both notice the potential threats and are not surprised. If one side is sneaking, the side that doesn't notice the potential threat is surprised. If both are sneaking, they surprise each other.
What are you trying to say here that you think I don't understand?
No, this is false. I made it so that the potential threat actually has to be unnoticed to get surprised............................like RAW specifies. If the goblins are sneaking down the hallway and turn the corner into the non-sneaking PCs, and the PCs fail perception, they are surprised. And vice versa.
The walls of the dungeon could be a threat, so if the PCs notice the walls, they can't be surprised by the goblins.
Until the casting, there was no stated intention to cause harm. So the Mimic only saw a group of people. Once the casting starts, which the Mimic has no clue is hostile, it is surprised for failing to notice a threat. According to what you have written.
Nothing in RAW says that a creature that has no idea a spell is being cast will automatically know it's a hostile action/threat, let alone retroactively notice the party was a threat before the casting of the spell and not be surprised.
The only way it can notice the party as a threat in time, is if it notices potential threats. Otherwise it has no chance to avoid surprise.
It's bizarre that you continue to fail to understand my actual position. I trust this isn't deliberate on your part, so I'm going to go through the steps of play as I see this encounter playing out to give you a chance to catch up in your understanding of what I'm actually saying:
1. The party, not trying to be stealthy as they travel, comes within sighting distance of the mimic which notices them immediately.
2. Because the mimic is trying to use its False Appearance ability, the DM determines whether or not it succeeds at remaining motionless. Of course, the DM can just decide it succeeds, but I would have it make a Dexterity (Stealth) check contested by the passive Perception scores of any members of the party who are keeping watch for hidden threats. Either way, according to the scenario described in the OP, it succeeds, and the DM describes to the players only that the party sees what looks to be an ordinary chest.
3. The players, despite any suspicions they may have about the "chest", state that the party enters the room, approaching within 15 feet (one move) of the mimic.
4. The player of the cleric states they cast toll the dead at the "chest".
5. Because combat is beginning in order to resolve the cleric's action, the DM determines who might be surprised. Because the party was not trying to be stealthy, the mimic noticed them in Step 1 and is not surprised. Because the mimic succeeded in using its False Appearance ability in Step 2, the party did not notice the mimic, and they are surprised.
6. The DM figures out where everyone is in relation to each other and to the mimic.
7. The DM calls for initiative, which is rolled by all the participants.
8. In round one, the party is surprised on their turns (see Step 5), and the mimic moves in and attacks them.
9. In round two, all the participants take their turns in initiative order, including the cleric who can now cast the spell they declared in Step 4 at the mimic.
I hope that clears things up a little.