Carpet spawned players don't trigger events such as __on_player_drops_item
Ghoulboy78 opened this issue ยท 5 comments
I spawned in a player, did /player x drop, and it droppped it, but nothing happened. I was hooked up to print the player's name who dropped it, but did nothing.
Seeing as there are various PRs around to fix various parts of this, and then this almost three year old 'rfc' labelled issue for it, I'm gonna heed the request and comment ;P
Yes. Bots should trigger player events.
In general we want them to be a player like as possible, and players trigger these events, so...
I've been able to work around the issues in the automated testing scripts I've been working on, but they would be less bloated and a little nicer to look at without my hacks (only a little ofc, they are test scripts).
Something that should definitely be added with any 'fixes' for this is an easy way to distinguish (in scarpet) between a real player and a bot (if not available now); but I argue bots should trigger these events, for what it is worth, my opinion being clearly biased!
To be more clear, here is how to reproduce:
- Create a script test.sc: (don't really need, but im not very good with command line apps)
__config()->{'stay_loaded'->true};
__on_player_drops_item(player,item)->print(str('Player %s dropped %s',player, item:0))
- Drop an item, it should print ur name correctly
- Run the command:
/player Steve spawn
, give him an item, then/player Steve drop
- It does not print Steve's name in the chat