Let \(\mathcal {M}\) be a prime \(*\) -algebra over \(\mathbb {C}\) with \(\operatorname {dim} (\mathcal {M})>1\) and \(\lambda \) be a nonzero scalar. In this paper, we prove that a nonlinear map \(\psi : \mathcal {M} \rightarrow \mathcal {M}\) satisfies \(\begin{aligned} \psi ([[L, M]_{\bullet }^{\lambda }, N]_{\bullet }^{\lambda })=[[\psi (L), M]_{\bullet }^{\lambda }, N]_{\bullet }^{\lambda }+[[L, \psi (M)]_{\bullet }^{\lambda }, N]_{\bullet }^{\lambda } + [[L, M]_{\bullet }^{\lambda }, \psi (N)]_{\bullet }^{\lambda } \end{aligned}\) for all \(L, M, N \in \mathcal {M}\) is additive on \(\mathcal {M}\) . Moreover, it is demonstrated that \(\psi \) is an additive \(*\) -derivation and \(\psi (\lambda L)=\lambda \psi (L)\) for all \(L \in \mathcal {M}\) , where \([L, M]_\bullet ^{\lambda }=L M^*-\lambda M L^*\) , when \(|\lambda |^2=1\) but \(\lambda \ne \pm 1\) . Moreover, an application of our result has been discussed on local derivations.