You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[CHAT] [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[CHAT] [Skript] Skript's documentation can be found here: https://skriptlang.github.io/Skript
[CHAT] [Skript] Server Version: git-Paper-338 (MC: 1.17.1)
[CHAT] [Skript] Skript Version: 2.6-beta3
[CHAT] [Skript] Installed Skript Addons:
[CHAT] [Skript] - skript-reflect v2.2.2-dev (https://github.com/TPGamesNL/skript-reflect)
Bug Description
When you pass a block to a function that requires an object, the type of the variable will not be a block (using if {_object} is a block:). When I try it with item, it works as expected, but not with block. This works in 2.6-beta1, but breaks in 2.6-beta 2 or 3.
Expected Behavior
When passing it a block type, it will be a block type in the function.
Steps to Reproduce
This is the code I used: (It needs skript-reflect for broadcasting the class information)
function getType(object:object):
broadcast "&6Testing&f %{_object}%"
broadcast "&6Type:&f %{_object}'s class%"
broadcast "It is a block" if {_object} is a block
broadcast "It is an item" if {_object} is an item
broadcast ""
command /testBlock:
trigger:
broadcast "&4Testing block"
getType(block below player)
command /testItem:
trigger:
broadcast "&4Testing item"
getType(player's tool)
This actually happens because Skript isn't checking if the variable is of the type block, it is checking if the variable is the visual effect 'block with a shield', because the pattern of that visual effect isn't great. This is explained here, and will be fixed in #4123
TPGamesNL
added
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
priority: medium
Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
labels
Oct 29, 2021
TheLimeGlass
added
duplicate
For bugs or requests that have already been made and are currently open.
and removed
bug
An issue that needs to be fixed. Alternatively, a PR fixing an issue.
priority: medium
Issues that are detrimental to user experience (prohibitive bugs or lack of useful implementation).
PR available
Issues which have a yet-to-be merged PR resolving it
labels
Aug 2, 2023
Skript/Server Version
Bug Description
When you pass a block to a function that requires an object, the type of the variable will not be a block (using if {_object} is a block:). When I try it with item, it works as expected, but not with block. This works in 2.6-beta1, but breaks in 2.6-beta 2 or 3.
Expected Behavior
When passing it a block type, it will be a block type in the function.
Steps to Reproduce
This is the code I used: (It needs skript-reflect for broadcasting the class information)
Errors or Screenshots
Screenshot
Other
No response
Agreement
The text was updated successfully, but these errors were encountered: