items held by player's cursor get deleted when giving a player an item
Skript/Server Version
Server version: git-Paper-411 (MC: 1.17.1)
Skript version: 2.6.3
Bug Description
While a player is holding any item with their cursor, if a skript that gives a player an item or adds an item to the player's inventory is executed, the item(s) held by the player's cursor will vanish. the held items dont even have to be the same as the given item although it happens to both. i then tried to spawn one of the items at the player's location instead, but my code was a periodical event so it wouldnt let me. executing a console give command doesnt delete any items, although you cant do world-specific commands as far as i know so i came here lol.
Expected Behavior
the item(s) should stay in the player's cursor or at least go back into their inventory, as deleting items isnt really a... good thing.
Steps to Reproduce
`every 10 seconds: loop all players: add 1 of tripwire hook named "&dAFK Key" to loop-player's inventory
every 10 seconds: loop all players: give loop-player 1 of tripwire hook named "&dAFK Key"```
then hold any item with your cursor and wait, when the next afk key is added to your inventory, the item you were holding will vanish.
Errors or Screenshots
https://outplayed.tv/media/dlXyxP
exact demonstration if you use the code above
Other
nah
Agreement
- [x] I have read the guidelines above and affirm I am following them with this report.
First glance of the issue it might be because of https://github.com/SkriptLang/Skript/blob/224cd6281ac9546d116f56a8c92f054a015c379f/src/main/java/ch/njol/skript/classes/data/DefaultChangers.java#L276
is there any way to get around this?
I can't reproduce this on paper 1.19.2 using this script:
every second:
give dirt to all players
I also tried the test script in the OP and couldn't reproduce with that either.
Closing due to being unable to reproduce and no reply
Having a similar issue,
every tick:
set slot 0 of "Bramsy" parsed as player to stick
Only applies in creative. Makes survival inventory jittery and skippy, however
https://github.com/SkriptLang/Skript/assets/89806653/92f935cc-15ac-41cb-8ff4-77661b11acd3
This was fixed in #5476, and will be applied to the next beta release (beta3).
This was fixed in #5476, and will be applied to the next beta release (beta3).
This is not the case. I can replicate on a current build of the master branch.
https://github.com/SkriptLang/Skript/assets/87666305/e99b6b53-79c0-4c22-862f-f6a5445045fb
Happens on skript 2.8.0 on git-Paper-393 (MC: 1.20.4)
It only happens when your in creative mode, so your fine if your players are in survival all of the time.