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

Passing block type to object function won't stay as a block type #4381

Closed
1 task done
EndergamerHUN opened this issue Oct 28, 2021 · 2 comments
Closed
1 task done
Labels
duplicate For bugs or requests that have already been made and are currently open.

Comments

@EndergamerHUN
Copy link

Skript/Server Version

[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)

Errors or Screenshots

Screenshot

Other

No response

Agreement

  • I have read the guidelines above and confirm I am following them with this report.
@TPGamesNL
Copy link
Member

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 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
@TPGamesNL TPGamesNL added the PR available Issues which have a yet-to-be merged PR resolving it label Oct 29, 2021
@TheLimeGlass
Copy link
Collaborator

TheLimeGlass commented Aug 2, 2023

Actually a duplicate of #5536 fixed at #5809

@TheLimeGlass 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate For bugs or requests that have already been made and are currently open.
Projects
None yet
Development

No branches or pull requests

3 participants