Skip to content
New issue

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

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

Already on GitHub? # to your account

Skript error #3060

Closed
sleepstone opened this issue Jun 19, 2020 · 4 comments
Closed

Skript error #3060

sleepstone opened this issue Jun 19, 2020 · 4 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. duplicate For bugs or requests that have already been made and are currently open.

Comments

@sleepstone
Copy link

Description

I have no idea what this is but I was told to report it

Steps to Reproduce

Skript code that caused the error:

on load:
     set {game} to false

command /startgame:
     trigger:
          command "/tp @a 3.5 70 -6.5 facing ~ ~ 90"
          set {game} to true

every 20 ticks in "world":
     if {game} is true:
          message "Hello" to server
          drop 1 of iron ingot at location(3, 69, -10)

Expected Behavior

The iron ingot was going to drop in a certain location on the world

Errors / Screenshots

https://gist.githubusercontent.com/pythermal/8557f70a546547128574e27ffa1ebc2f/raw/442cf9e9232a929b399b46d4e7d9bcff9d158df1/error.txt

Server Information

  • Server version/platform: Minecraft 1.15.2, Spigot
  • Skript version: 2.4.1

Additional Context

Sorry if this is a well-known bug or I'm bad at skript, I really have no idea what I'm doing

@sleepstone
Copy link
Author

Update: The code works fine when i added a fourth "world" argument to the location function

on load:
     set {game} to false

command /startgame:
     trigger:
          command "/tp @a 3.5 70 -6.5 facing ~ ~ 90"
          set {game} to true

every 20 ticks in "world":
     if {game} is true:
          message "Hello" to server
          drop 1 of iron ingot at location(3, 69, -10, world "world")

@Pikachu920
Copy link
Member

the original code is actually meant to work so this is a bug, see the following snippets:

/**
* Expression that will provide default value of this parameter
* when the function is called.
*/
@Nullable
final Expression<? extends T> def;

new Parameter<>("world", Classes.getExactClassInfo(World.class), true, new EventValueExpression<>(World.class)),

Skript.registerEvent("*Periodical", EvtPeriodical.class, ScheduledEvent.class, "every %timespan% in [world[s]] %worlds%")

EventValues.registerEventValue(ScheduledEvent.class, World.class, new Getter<World, ScheduledEvent>() {
@Override
@Nullable
public World get(final ScheduledEvent e) {
return e.getWorld();
}
}, 0, "There's no world in a periodic event if no world is given in the event (e.g. like 'every hour in \"world\"')", ScheduledNoWorldEvent.class);
}

@Pikachu920 Pikachu920 added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jun 19, 2020
@TheLimeGlass
Copy link
Contributor

Duplicate #1465

@ShaneBeee
Copy link
Contributor

Closing this as LimeGlass pointed out, its a duplicate of #1465

@ShaneBeee ShaneBeee added the duplicate For bugs or requests that have already been made and are currently open. label Aug 6, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. duplicate For bugs or requests that have already been made and are currently open.
Projects
None yet
Development

No branches or pull requests

5 participants