Skript icon indicating copy to clipboard operation
Skript copied to clipboard

event-item is broken in Inventory Click Event

Open MinecraftMan1013number2 opened this issue 2 years ago • 20 comments

Skript/Server Version

[16:37:46 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[16:37:46 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[16:37:46 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[16:37:46 INFO]: [Skript] Server Version: git-Paper-81 (MC: 1.19)
[16:37:46 INFO]: [Skript] Skript Version: 2.6.3
[16:37:46 INFO]: [Skript] Installed Skript Addons: None
[16:37:46 INFO]: [Skript] Installed dependencies: None

Bug Description

If I use event-item in an inventory click event, it always returns .

Expected Behavior

It broadcasts whatever the result is.

Steps to Reproduce

To test this, I used both pieces of code below. I clicked on a diamond sword with no name (which is expected to return none), but then I clicked on a sword that I renamed in an anvil and it still broadcasted none.

on inventory click:
	broadcast "%name of event-item%"
on inventory click:
	broadcast "%event-item%"

Errors or Screenshots

None

Other

No response

Agreement

  • [X] I have read the guidelines above and affirm I am following them with this report.

MinecraftMan1013number2 avatar Aug 08 '22 16:08 MinecraftMan1013number2

I can't reproduce (both skript renamed and anvil renamed work, even with diamond sword) image

Can you send a video of you testing?

AyhamAl-Ali avatar Aug 09 '22 09:08 AyhamAl-Ali

I also added a named item with color, and still the same https://user-images.githubusercontent.com/70504198/183656041-cd4fbb33-c819-4187-a979-58de569c6037.mp4

I don't think this would chage anything, but the only other plugin I have installed is ViaVersion 4.4.2-SNAPSHOT

MinecraftMan1013number2 avatar Aug 09 '22 13:08 MinecraftMan1013number2

Seems like something is affect this, do you have any other scripts running?

AyhamAl-Ali avatar Aug 09 '22 13:08 AyhamAl-Ali

no, this is a fresh server.

MinecraftMan1013number2 avatar Aug 09 '22 14:08 MinecraftMan1013number2

Can you upload the whole server as a .zip here

AyhamAl-Ali avatar Aug 09 '22 15:08 AyhamAl-Ali

This also happened to me, it definitely isn't a server issue because I just went back to v2.6.2, and event-item started working again.

Mythochu avatar Aug 09 '22 16:08 Mythochu

Can you upload the whole server as a .zip here

https://file.io/hmpyaBzcPLoT

MinecraftMan1013number2 avatar Aug 10 '22 15:08 MinecraftMan1013number2

maybe wait a tick before getting event-item? iirc, event-inventory returns something different if doesn't wait

wallace4BR avatar Aug 10 '22 15:08 wallace4BR

maybe wait a tick before getting event-item? iirc, event-inventory returns something different if doesn't wait

Still the same result for me

MinecraftMan1013number2 avatar Aug 13 '22 23:08 MinecraftMan1013number2

I also had the same problem. Any solution?

kimjunsung04 avatar Aug 15 '22 04:08 kimjunsung04

https://github.com/SkriptLang/Skript/commit/0372ad611477b08a1b285bf8d655e643ad19b086#diff-ab27ab8b1311587b5c719143d0bd197a4e311e0dd073ba820f04b608b9187ee4 I'm guessing, but it looks like something went wrong with that commit.

kimjunsung04 avatar Aug 15 '22 04:08 kimjunsung04

I cannot replicate. Is everyone using ViaVersion? If so what version is your client?

On a 1.19.2 client and 1.19.2 server with or without ViaVersion I cannot replicate.

ViaVersion is designed for lower minecraft versions like 1.9 server to add 1.9+ support. It really serves no purpose being on a server that is the latest (1.19.2) there is even a warning in console from ViaVersion stating this.

Are you also using ViaBackwards? Because we need to know these things too.

Video and Server .jar don't work.

TheLimeGlass avatar Aug 15 '22 06:08 TheLimeGlass

0372ad6#diff-ab27ab8b1311587b5c719143d0bd197a4e311e0dd073ba820f04b608b9187ee4 I'm guessing, but it looks like something went wrong with that commit.

This hasn't been added to any public release yet. Unrelated.

TheLimeGlass avatar Aug 15 '22 06:08 TheLimeGlass

This hasn't been added to any public release yet. Unrelated.

I haven't checked that yet, thanks

kimjunsung04 avatar Aug 15 '22 06:08 kimjunsung04

I cannot replicate. Is everyone using ViaVersion? If so what version is your client?

On a 1.19.2 client and 1.19.2 server with or without ViaVersion I cannot replicate.

ViaVersion is designed for lower minecraft versions like 1.9 server to add 1.9+ support. It really serves no purpose being on a server that is the latest (1.19.2) there is even a warning in console from ViaVersion stating this.

Are you also using ViaBackwards? Because we need to know these things too.

Video and Server .jar don't work.

I am not using ViaVersion.

kimjunsung04 avatar Aug 15 '22 07:08 kimjunsung04

I am not using ViaVersion.

Send your plugin list, and how you created the item and what you did to replicate the issue.

TheLimeGlass avatar Aug 15 '22 07:08 TheLimeGlass

Can replicate on 1.19.2 paper, 2.6.3 Skript, fresh install. Used vanilla 1.19.2 client.

Used code:

on inventory click:
	broadcast "%name of event-item%"
on inventory click:
	broadcast "%event-item%"

Created item with effect command !set name of player's tool to "test" Created item with anvil rename All broadcasts were none. image

image

Used server: https://drive.google.com/file/d/1Z029Vo8dTrxB8ben_L70O_OaIiQ4BSDo/view?usp=sharing

sovdeeth avatar Aug 15 '22 07:08 sovdeeth

Send your plugin list, and how you created the item and what you did to replicate the issue.

The plugin only uses Skript and the bucket uses purpur In the above state, on click inventory at the event Calling event-item will result in none.

kimjunsung04 avatar Aug 15 '22 07:08 kimjunsung04

I also discovered this, but solved it by replacing event-item with event-slot, including 'index of event-slot'

ZConnorZ avatar Aug 15 '22 08:08 ZConnorZ

Fixed in 2.6.4, but there is another issue to fix this from happening on other event values https://github.com/SkriptLang/Skript/issues/5032

TheLimeGlass avatar Aug 15 '22 22:08 TheLimeGlass