Update WaitForItemUsedAction will cause the action registered by ItemComponent.OnUsed to be overwritten but this is unexpected behavior in XML code #14826
Originally posted by **zhu-rengong** October 8, 2024
### Disclaimers
- [X] I have searched the issue tracker to check if the issue has already been reported.
- [X] My issue happened while using mods.
### What happened?
If there is a Scripted Event with WaitForItemUsedAction, when you trigger the event twice, the OnUsed action registered for the tagged Item will be overwritten.
Take the following script as an example:
I expect that when you use a revolver, a round will be spawned in the revolver, but i got only 1 round after triggering the same event twice.
```xml
```
### Reproduction steps
1. copy the above xml code
2. type in `triggerevent spawn_round_after_use_revolver` twice
3. fire revolver, you will only get 1 round spawned
4. type in `triggerevent spawn_round_after_use_revolver` and `triggerevent spawn_round_after_use_revolver_copy1` once
5. fire revolver, you will get 2 rounds spawned in expectation
https://github.com/user-attachments/assets/c2fde3fb-3f89-43e3-91af-b2ac5611c760
### Bug prevalence
Happens every now and then
### Single player or multiplayer?
Single player
### -
_No response_
### Version
v1.5.9.2 (Summer Update Hotfix 2)
### -
_No response_
### Which operating system did you encounter this bug on?
Windows
### Relevant error messages and crash reports
_No response_
Discussed in https://github.com/FakeFishGames/Barotrauma/discussions/14795