Skript icon indicating copy to clipboard operation
Skript copied to clipboard

items held by player's cursor get deleted when giving a player an item

Open ZelPie opened this issue 3 years ago • 2 comments

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.

ZelPie avatar Sep 01 '22 01:09 ZelPie

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

AyhamAl-Ali avatar Sep 01 '22 11:09 AyhamAl-Ali

is there any way to get around this?

ZelPie avatar Sep 01 '22 16:09 ZelPie

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.

Pikachu920 avatar Oct 27 '22 02:10 Pikachu920

Closing due to being unable to reproduce and no reply

Pikachu920 avatar Dec 01 '22 05:12 Pikachu920

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

Bramsies avatar May 10 '23 23:05 Bramsies

This was fixed in #5476, and will be applied to the next beta release (beta3).

NotSoDelayed avatar May 11 '23 00:05 NotSoDelayed

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.

sovdeeth avatar May 11 '23 00:05 sovdeeth

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)

fletchermed1 avatar Mar 27 '24 00:03 fletchermed1

It only happens when your in creative mode, so your fine if your players are in survival all of the time.

KingCreeperz avatar May 25 '24 02:05 KingCreeperz