Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event-slot in the event "on prepare craft" is the bottom right slot of the crafting table #4747

Closed
1 task done
JakeGBLP opened this issue May 6, 2022 · 3 comments
Closed
1 task done
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. good first issue An issue that would be good for a first-time contributor to make a PR for priority: low Issues that are not harmful to the experience but are related to useful changes or additions.

Comments

@JakeGBLP
Copy link
Contributor

JakeGBLP commented May 6, 2022

Skript/Server Version

[11:23:06 INFO]: �7[�6Skript�7]�r Skript's aliases can be found here: �3https://github.com/SkriptLang/skript-aliases
[11:23:06 INFO]: �7[�6Skript�7]�r Skript's documentation can be found here: �3https://skriptlang.github.io/Skript
[11:23:06 INFO]: �7[�6Skript�7]�r Server Version: �3git-Paper-278 (MC: 1.18.2)
[11:23:06 INFO]: �7[�6Skript�7]�r Skript Version: �32.6.1
[11:23:06 INFO]: �7[�6Skript�7]�r Installed Skript Addons: 
[11:23:06 INFO]: �7[�6Skript�7]�r  - skript-reflect v2.3 (https://github.com/TPGamesNL/skript-reflect)
[11:23:06 INFO]: �7[�6Skript�7]�r  - skRayFall v1.9.27 (https://sk.rayfall.net/)
[11:23:06 INFO]: �7[�6Skript�7]�r  - SkBee v1.15.2 (https://github.com/ShaneBeee/SkBee)
[11:23:06 INFO]: �7[�6Skript�7]�r Installed dependencies: �3None

Bug Description

The on prepare craft event has 3 event values, event-player, event-string and event-slot and for some this last one is the 9th slot of the crafting grid.

Expected Behavior

the event slot should be a relevant slot like the crafting result slot (or slot 0)

Steps to Reproduce

on preparing craft: {-preparing::%player%} != true set {-preparing::%player%} to true send index of event-slot set event-slot to dirt delete {-preparing::%player%}

the reason why i used a variable is because otherwise it would create an infinite loop (credit to Font#7283 for this)

anyway, by using this code or in general by using the event-slot value, it will turn out to be the 9th slot

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
@TheLimeGlass TheLimeGlass added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: low Issues that are not harmful to the experience but are related to useful changes or additions. labels Jun 29, 2022
@TheLimeGlass
Copy link
Contributor

TheLimeGlass commented Jun 29, 2022

The 9 at

return new InventorySlot(e.getInventory(), 9);
needs to be changed to 0.

Wiki information https://wiki.vg/Inventory

@TPGamesNL
Copy link
Member

TPGamesNL commented Jun 29, 2022

If the index depends on the MC version, we may have to adjust that value based on isMinecraftVersion

@TheLimeGlass
Copy link
Contributor

If the index depends on the MC version, we may have to adjust that value based on isMinecraftVersion

I did protocol research and it's never been 9 the 0 was always the result slot since 2011 (when wiki.vg was made)

@AyhamAl-Ali AyhamAl-Ali added the good first issue An issue that would be good for a first-time contributor to make a PR for label Jun 29, 2022
@AyhamAl-Ali AyhamAl-Ali added the PR available Issues which have a yet-to-be merged PR resolving it label Jun 29, 2022
@TheLimeGlass TheLimeGlass added completed The issue has been fully resolved and the change will be in the next Skript update. and removed PR available Issues which have a yet-to-be merged PR resolving it labels Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. good first issue An issue that would be good for a first-time contributor to make a PR for priority: low Issues that are not harmful to the experience but are related to useful changes or additions.
Projects
None yet
Development

No branches or pull requests

4 participants