If you are showing off a knife or a gun, tbe police have authority to demand you drop it.
While your statement is generally true, I would assert that on my own property and absent me threatening others, there is no “authority” for the police to demand anything. It is also possible that they are the trespassers and need to remove themselves.
Now I understand that may not be the law in many locations, but the police authority is not absolute. In fact, if the arrest is unlawful, citizens are able to resist up to and including taking the officers life (SCOTUS ruling in Plummer v. State, 136 Ind. 306)