GithubHelp home page GithubHelp logo

skriptlang / skript Goto Github PK

View Code? Open in Web Editor NEW
981.0 54.0 352.0 22.69 MB

Skript is a Bukkit plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.

Home Page: https://docs.skriptlang.org

License: GNU General Public License v3.0

Java 100.00% Shell 0.01%
java bukkit spigot scripting-language gradle skript minecraft hacktoberfest

skript's Introduction

Skript Language


Skript

Skript is a Minecraft plugin for Paper/Spigot, which allows server owners and other people to modify their servers without learning Java. It can also be useful if you do know Java; some tasks are quicker to do with Skript, and so it can be used for prototyping etc.

This Github fork of Skript is based on Mirreski's improvements which was built on Njol's original Skript.

Requirements

Skript requires Spigot to work. You heard it right, CraftBukkit does not work. Paper, which is a fork of Spigot, is recommended; it is required for some parts of Skript to be available.

Skript supports only the latest patch versions of Minecraft 1.9+. For example, this means that 1.16.5 is supported, but 1.16.4 is not. Testing with all old patch versions is not feasible for us.

Minecraft 1.8 and earlier are not, and will not be supported. New Minecraft versions will be supported as soon as possible.

Download

You can find the downloads for each version with their release notes in the releases page.

Two major feature updates are expected each year in January and July, with monthly patches occurring in between. For full details, please review our release model.

Documentation

Documentation is available here for the latest version of Skript.

Reporting Issues

Please see our contribution guidelines before reporting issues.

Help Us Test

Wanting to help test Skript's new features and releases? You can head on over to our Official Testing Discord, and whenever we start testing new features/releases you will be the first to know.

Please note this is not a help Discord. If you require assistance with how to use Skript please check out the Relevant Links section for a list of available resources to assist you.

A Note About Add-ons

We don't support add-ons here, even though some of Skript developers have also developed their own add-ons.

Compiling

Skript uses Gradle for compilation. Use your command prompt of preference and navigate to Skript's source directory. Then you can just call Gradle to compile and package Skript for you:

./gradlew clean build # on UNIX-based systems (mac, linux)
gradlew clean build # on Windows

You can get source code from the releases page. You may also clone this repository, but that code may or may not be stable.

Compiling Modules

Parts of Skript are provided as Gradle subprojects. They require Skript, so they are compiled after it has been built. For this reason, if you want them embedded in Skript jar, you must re-package it after compiling once. For example:

./gradlew jar

Note that modules are not necessary for Skript to work. Currently, they are only used to provide compatibility with old WorldGuard versions.

Testing

Skript has some tests written in Skript. Running them requires a Minecraft server, but our build script will create one for you. Running the tests is easy:

./gradlew (quickTest|skriptTest|skriptTestJava8|skriptTestJava17|skriptTestJava21)

quickTest runs the test suite on newest supported server version. skriptTestJava21 (1.20.6+) runs the tests on Java 21 supported versions. skriptTestJava17 (1.17-1.20.4) runs the tests on Java 17 supported versions. skriptTestJava8 (1.13-1.16) runs the tests on Java 8 supported versions. skriptTest runs the tests on all versions. That is, it runs skriptTestJava8, skriptTestJava17, and skriptTestJava21.

By running the tests, you agree to Mojang's End User License Agreement.

Importing to Eclipse

With new Eclipse versions, there is integrated Gradle support, and it actually works now. So, first get latest Eclipse, then import Skript as any Gradle project. Just make sure to keep the configuration when the importer asks for that!

If you encounter strange issues, make sure you follow the instructions above and have actually downloaded latest Eclipse or update your installation correctly. Skript's new Gradle version (starting from dev26) does not work very well with older Eclipse versions. Also, do not use Gradle STS; it is outdated.

Importing to IDEA

You'll need to make sure that nullness annotations are working correctly. Also, when sending pull requests, make sure not to change IDEA configuration files that may have been stored in the repository.

Releasing

./gradlew clean build
./gradlew <flavor>Release

Available flavors are github and spigot. Please do not abuse flavors by compiling your own test builds as releases.

Contributing

Please review our contribution guidelines. In addition to that, if you are contributing Java code, check our coding conventions.

Maven Repository

If you use Skript as (soft) dependency for your plugin, and use maven or Gradle, this is for you.

First, you need to add the Maven repository at the END of all your repositories. Skript is not available in Maven Central.

repositories {
    maven {
        url 'https://repo.skriptlang.org/releases'
    }
}

Or, if you use Maven:

<repositories>
    <repository>
        <id>skript-releases</id>
        <name>Skript Repository</name>
        <url>https://repo.skriptlang.org/releases</url>
    </repository>
</repositories>

For versions of Skript after dev37 you might need to add the paper-api repository to prevent build issues.

maven {
    url 'https://repo.destroystokyo.com/repository/maven-public/'
}

Or, if you use Maven:

<repository>
    <id>destroystokyo-repo</id>
    <url>https://repo.destroystokyo.com/content/repositories/snapshots/</url>
</repository>

Then you will also need to add Skript as a dependency.

dependencies {
    implementation 'com.github.SkriptLang:Skript:[versionTag]'
}

An example of the version tag would be dev37c.

Note: If Gradle isn't able to resolve Skript's dependencies, just disable the resolution of transitive dependencies for Skript in your project.

Or, if you use Maven:

<dependency>
    <groupId>com.github.SkriptLang</groupId>
    <artifactId>Skript</artifactId>
    <version>[versionTag]</version>
    <scope>provided</scope>
</dependency>

Relevant Links

Note that these resources are not maintained by Skript's developers. Don't contact us about any problems you might have with them.

Developers

You can find all contributors here.

All code is owned by its writer, licensed for others under GPLv3 (see LICENSE) unless otherwise specified.

skript's People

Contributors

28andrew avatar apickledwalrus avatar ayhamal-ali avatar bensku avatar blueyescat avatar dependabot[bot] avatar fednelpat avatar frankusmiruk avatar fusezion avatar jroy avatar kiip1 avatar mirreski avatar moderocky avatar mr-darth avatar nicofisi avatar njol avatar notsodelayed avatar officialdonut avatar pikachu920 avatar sashie avatar shanebeee avatar sovdeeth avatar supertassu avatar syst3ms avatar tcinubkxfamy avatar thebentobox avatar thelimeglass avatar tpgamesnl avatar underscoretud avatar wealthyturtle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skript's Issues

On command

On my server a lot of command permissions are used with variables (ie: {rank::staff::%player%}). I like to use custom permission messages for some commands (such as /op).

Previously, I would be able to use the following just fine:

on command "/op":
    if {rank::staff::%player%} is not "admin" or "owner":
        cancel event
        message "{@noperms}"

Now, with both this version and nfell's, I can only use if {rank::staff::%player%} is not set to actually catch and cancel the event.

Also, it seems like having a multiple options in if command contains .... doesn't work either.

on command:
    if command contains "spigot" or "bukkit" or "bukkit:" or "minecraft":
        if player is not op:
            cancel event
            message "&4* &cUnknown command. &7Type &f/help [topic] &7for help."

Anvil inventory doesn't let you do anything meaningful

When you use the code below and then try to rename something on the anvil window it will seem like you get the item but when you drop it it will revert back to what it was before.

Also sound is missing from using the anvil.

Also when you open the anvil window and try to drop items from your inventory they seem to disappear but if you relog your items are still in your inventory.

on right click on anvil:
  cancel event
  open anvil window to player

Console error:
http://pastie.org/private/7bgpoah4wrqshk5cdqm9qg

on smelt event's "result slot of event-block" is broken

Skript version:
Dev3

Spigot version:
This server is running CraftBukkit version git-Spigot-b1c1b55-7d73fbb (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)

The issue:

  1. Place furnace
  2. Smelt something
  3. Try to detect what is in result slot.

What happens:
Only "block's result" works.

What should happen:
All the syntax should work, ie:

[the] (ore|fuel|result)[s] [slot[s]] of %blocks%
%blocks%'[s] (ore|fuel|result)[s] [slot[s]]

Steps to reproduce:

on smelt:
  if block's result is stone brick:        # This works
    broadcast " DEBUG: ""block's result"" works OK?"
  if result slot of event-block is stone brick:  # This doesn't work
    broadcast " DEBUG: ""result slot of event-block"" works OK?"
  if result slot of block is stone brick:   # This doesn't work
    broadcast " DEBUG: ""result slot of block"" works OK?"

damage cause and attacker are bugged

This bug has been in Skript for a long time: The %damage cause% and %attacker% are giving out wrong information when damaging the player by code.

Steps to reproduce:

  1. Hit player, burn him or generally take damage from something.
command /damageplayer <player>:
  trigger:
    damage arg 1 by 999

on death:
  broadcast " DEBUG: damage cause: %damage cause%, attacker: %attacker%"  
  1. The damage cause and attacker will now be the last source of damage received before damaging the victim with /damageplayer command.

This is not nice for example if you have a skript which keeps track of who or what killed whom. The information will be wildly inaccurate.

Perhaps the ideal fix for this would be simply removing the reference to damage cause + attacker when using the damage expression or setting the damage cause to "magic" when giving damage with code and removing the value of the attacker or setting it to unknown (I don't how it works) - or even better, if possible, making it possible to define the damage cause and attacker.

Example of what the new syntax might be like:
damage %entity% by %integer% [heart|s] [[set] cause [to] "%damage cause%" [[set] attacker [to]] %entity%]

Mojang is removing data-values, vanilla Skript needs NBT support

We have long known this day was coming and now with 1.9 it is starting to really happen. Mojang is removing data-values and transfering them to NBT. This is a serious problem because vanilla Skript doesn't support NBT data at the moment.

Example:
potion of:8196 doesn't exist anymore. There is now only potion (373:0) with NBT tag {Potion:"minecraft:long_poison"}.

Same thing has happened with spawn eggs, etc.

At the very least vanilla Skript needs to have a rudimentary way of reading and modifying NBT data in entities, items and blocks - perhaps leaving it to the user's discretion whether or not the data is actually correct.

This would give some basic support to a feature that is going to be more and more important in the future. And if done without checks on whether or not the NBT can actually be given, etc, this would save considerable time implementing it - meaning we could have full NBT support right now and never worry about updating it with new tags as they come along - the users would do that in their own code.

I don't know whether Spigot supports this or not but if it doesn't yet have a proper API for it - it would be prudent to make one and make a pull request for Spigot. That way we would avoid having to use addons with NMS for what is becoming a basically essential feature.

Particle Effects

Hi there,
can you add particle effects into Skript?

Something like:
display 200 of particle heart at player

This would be awesome :-)

on region enter event doesn't contain region data

The issue:
On Region Enter event doesn't give out any region data. %region at location of player% -> ""

Version:
Latest Skript (by bensku).

Spigot version:
This server is running CraftBukkit version git-Spigot-3104eb1-daf4514 (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)

Steps to reproduce:

On Region Enter:
  broadcast " DEBUG: &a%player%&f On Region Enter (region at player: %region at location of player%)"

New feature: event-tool/hand/etc of player/entity

Let's consider this scenario:

on player consuming:                                 
  if name of event-item is "&fWhiskey":       # Player is drinking whiskey.
    cancel event                                            # We are using magic potions for nice color, cancel effects.
    if name of tool of player is "&fWhiskey":  # Now we have to find out where the whiskey is.
      remove 1 of tool from tool of player       # This wasn't a problem before 1.9 added two hands.
      give glass bottle to player                      # Now it bring a new screnario where there is amount of
    else if name of off-tool of player is "&fWhiskey":  # uncertainty where the event-item is
      remove 1 of off-tool from tool of player   # and a possibility to choose the wrong hand
      give glass bottle to player         # accidentally if we are comparing same base items for example.

So how to fix this? Best way to fix it would be letting Skript decide. That way we wouldn't have to clutter our code with extra checks.

My suggestion:

on player consuming:                                 
  if event-tool of player is "&fWhiskey": 
    cancel event                                            
    remove 1 of event-tool from event-tool of player
    give glass bottle to player

Event-tool would be something that exists in events, for example:

  • on damage -> %weapon/event-tool of entity%
  • on left/right click -> %event-tool of entity%
  • on projectile hit -> %weapon/event-tool of shooter%

Etc.

Skript would basically check what the player/entity is doing in the event and if he is doing it with his main tool of off-tool and Skript would store the information which one it is in %event-tool of entity%.

Does this make sense?

Horses are broken in dev3

Getting new errors after updating to dev3:

[22:11:36] [Server thread/ERROR]: [Skript] can’t understand this event: ‘on right click on horse or pig or donkey or mule’ (aseet.sk, line 748: on right click on horse or pig or donkey or mule:’)
[22:11:36] [Server thread/ERROR]: [Skript] Can’t compare an entity with (‘riding horse’ or ‘pig’) (aseet.sk, line 808: if victim is riding horse or pig:’)
[22:12:03] [Server thread/ERROR]: [Skript] Can’t compare an entity with a types.entitydisguise (vakaumukset.sk, line 400: if victim is horse:’)

The code is just:

on right click on horse or pig or donkey or mule:

Which used to work just fine in 1.8.

Void Damage

on damage:
    if damage cause is void:
        message "Ouch." to victim

Error:
Can't compare a damage cause with a biome

Using v11b

Inconsistencies in right click events

I can close my other issue if you'd like. This one will cover more cases.

In general, right click events in the current build don't always as intended. In the list, "non-usable items" will mean those with no right click action, while "usable items" have a right click action (food, blocks, bows, shields, etc). The issues currently present are:

  • Both hands empty: works as intended
  • Usable item in mainhand, empty offhand: works as intended
  • Empty mainhand, usable item in offhand: doesn't trigger click events when using interactable blocks. Example: shield in offhand, right click on a lever - event doesn't trigger.
  • Non-usable item in mainhand, empty offhand: triggers two entity interaction events. Example: axe in mainhand, empty offhand, right click a mob - triggers two events. Works as intended otherwise.
  • Empty mainhand, non-usable item in offhand: doesn't trigger right click events when clicking in open air. Doesn't trigger a basic right click event when clicking on entities. Example: axe in offhand, empty mainhand. Right click on nothing - event doesn't trigger. Right click on an entity and listen for overall "on right click" events - event doesn't trigger. "on right click on living entity" triggers, but searching for a generic "on right click" doesn't work in this situation.
  • Non-useable item in mainhand, usable item in offhand: Triggers two entity right click events, triggers no events when right clicking on interactable blocks.
  • Usable item in mainhand, nonusable item in offhand: works as intended

For testing, I was using this code:

on right click on living entity:
    send "Clicked on %event-entity%" to player

on right click:
    clicked block is set:
        send "Clicked on %clicked block%"
    else:
        send "Clicked on nothing"

For testing, I assumed something was working on intended if it met the following conditions:

  • When right clicking on nothing, it would send just "Clicked on nothing", triggering "on right click"
  • When right clicking blocks, it would send "Clicked on %clicked block%", including interactable blocks (levers)
  • When right clicking entities, it would send "Clicked on %event-entity%" AND "Clicked on nothing", because it should trigger both the entity click events and the generic "on right click" event.

Hope this helps!

Feature: More options for entities

Having more options for entities such as the age, donkey, mule, horse and specific types of things (such as the horses) can be helpful. Rabbit support would be cool too for their skins. Being able to use spawn a baby zombie for example.

No class info found for player

Im getting this with the lastest dev9b version

Notice the ' character at the end of No class info found for player', I don't know if it should be there

[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! [Skript] Severe Error:
[17:26:51] [Server thread/ERROR]: #!#! Could not load aura.sk
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! If you're developing an add-on for Skript this likely means that you have done something wrong.
[17:26:51] [Server thread/ERROR]: #!#! If you're a server admin however please go to http://dev.bukkit.org/server-mods/skript/tickets/
[17:26:51] [Server thread/ERROR]: #!#! and check whether this error has already been reported.
[17:26:51] [Server thread/ERROR]: #!#! If not please create a new ticket with a meaningful title, copy & paste this whole error into it,
[17:26:51] [Server thread/ERROR]: #!#! and describe what you did before it happened and/or what you think caused the error.
[17:26:51] [Server thread/ERROR]: #!#! If you think that it's a trigger that's causing the error please post the trigger as well.
[17:26:51] [Server thread/ERROR]: #!#! By following this guide fixing the error should be easy and done fast.
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! Stack trace:
[17:26:51] [Server thread/ERROR]: #!#! ch.njol.skript.SkriptAPIException: No class info found for player'
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.registrations.Classes.getClassInfo(Classes.java:242)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.getExprInfo(SkriptParser.java:1394)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse_i(SkriptParser.java:1115)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:220)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.SkriptParser.parse(SkriptParser.java:175)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.lang.Statement.parse(Statement.java:60)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadItems(ScriptLoader.java:650)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.command.Commands.loadCommand(Commands.java:467)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScript(ScriptLoader.java:469)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:245)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.ScriptLoader.loadScripts(ScriptLoader.java:199)
[17:26:51] [Server thread/ERROR]: #!#!     at ch.njol.skript.Skript$2.run(Skript.java:406)
[17:26:51] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71)
[17:26:51] [Server thread/ERROR]: #!#!     at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350)
[17:26:51] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:729)
[17:26:51] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400)
[17:26:51] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660)
[17:26:51] [Server thread/ERROR]: #!#!     at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559)
[17:26:51] [Server thread/ERROR]: #!#!     at java.lang.Thread.run(Thread.java:745)
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! Version Information:
[17:26:51] [Server thread/ERROR]: #!#!   Skript: 2.2-Fixes-V10
[17:26:51] [Server thread/ERROR]: #!#!   Bukkit: 1.9-R0.1-SNAPSHOT
[17:26:51] [Server thread/ERROR]: #!#!   Minecraft: 1.9
[17:26:51] [Server thread/ERROR]: #!#!   Java: 1.8.0_66 (Java HotSpot(TM) 64-Bit Server VM 25.66-b17)
[17:26:51] [Server thread/ERROR]: #!#!   OS: Linux amd64 3.16.0-4-amd64
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! Running CraftBukkit: false
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! Current node: set {_c} to a block behind location of player (aura.sk, line 34)
[17:26:51] [Server thread/ERROR]: #!#! Current item: null
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! Thread: Server thread
[17:26:51] [Server thread/ERROR]: #!#! 
[17:26:51] [Server thread/ERROR]: #!#! End of Error.
[17:26:51] [Server thread/ERROR]: #!#! 

on place and on break events don't fire

The issue:
"on place" and "on break" events don't fire at all when placing/breaking blocks.

Version:
Latest Skript (by bensku).
*Spigot version: *
This server is running CraftBukkit version git-Spigot-3104eb1-daf4514 (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)

Steps to reproduce:

on place:
  broadcast " DEBUG: placing test"

on break:
  broadcast " DEBUG: breaking test"

Error message on console:
http://pastie.org/private/bsfth6wn1wzkn7cghwcvg

Safe explosion not working as expected

"Starting with Bukkit 1.4.5 and Skript 2.0 you can also create "safe explosions" which will damage entities but won't destroy any blocks."

But this does not do any damage to entities nearby:

on death:
if victim is a zombie:
create a safe explosion of force 10 at the victim

Can you fix it?

Adding loop-item to a variable/list is broken!

Code to test it:

on death of player:
    if victim's inventory contains a dirt:
        chance of 50%:
            remove a dirt from drops
            loop items in victim's inventory:
                remove loop-item from drops
                add loop-item to {inventory.%name of victim%::*}

on respawn:
    add {inventory.%name of player%::*} to player's inventory
    delete {inventory.%name of player%::*}
    stop

New feature: saturation

Just a reminder for you to add support for Spigot API's saturation to accompany the player's food levels which already have been implemented.

Without support for the saturation users will have to use vanilla /effect saturation which is clunky and not very precise or rely on addons which might or might not work because of other NMS features.

Quop requested this on SkUnity forums.

on pressure plate/on step [1.8]

When I use the trigger "on pressure plate" and cancel the event, it is not always triggered.

When using on walk or on step (same thing) they just teleport you through the ground. If you specify a block such as on step on [block] it teleport's you through the ground when you step on that block

on region enter/leave events fire twice

The issue:
On Region Enter/Leave events fire twice.

Version:
Latest Skript (by bensku).

Spigot version:
This server is running CraftBukkit version git-Spigot-3104eb1-daf4514 (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)

Steps to reproduce:

On Region Enter:
  broadcast " DEBUG: &a%player%&f On Region Enter (region at player: %region at location of player%)"

On Region Leave:
  broadcast " DEBUG: &a%player%&f On Region Leave (region at player: %region at location of player%)"

"can hold/give" doesn't handle space calculations correctly

Version: dev9b

  1. /give player stone 100000 - to fill up inventory
  2. Wear armor, boots, helmet, leggings and shield
  3. Run this code:
command /debugtest:
  trigger:
    if player can hold 64 bread:
      give 64 bread to player
    else:
      drop 64 bread at location of player

It drops 64 bread on the ground.

  1. Drop the shield - you now have all slots filled except for the off-hand.
  2. Run the command again.

No bread on the ground + no bread in off-hand. It tries to give you the bread but thinks all slots are filled. So this is either an error in give logic (should you be able to fill off-hand with give?) or error in "can hold" calculations (if you can't fill off-hand, then you should ignore it).

IMO, there's no reason why give shouldn't put the items in off-hand since it's empty and perfectly capable of holding the items.

Exception on startup

[21:47:36] [Server thread/WARN]: [Skript] Task #23 for Skript v2.2-Fixes-V10 generated an exception
java.lang.NullPointerException
    at java.lang.Class.isAssignableFrom(Native Method) ~[?:1.8.0_72-internal]
    at ch.njol.skript.registrations.Classes.sortClassInfos(Classes.java:147) ~[?:?]
    at ch.njol.skript.registrations.Classes.onRegistrationsStop(Classes.java:100) ~[?:?]
    at ch.njol.skript.Skript.stopAcceptingRegistrations(Skript.java:877) ~[?:?]
    at ch.njol.skript.Skript.access$2(Skript.java:872) ~[?:?]
    at ch.njol.skript.Skript$2.run(Skript.java:347) ~[?:?]
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftTask.run(CraftTask.java:71) ~[spigot.jar:git-Spigot-944aa20-8d16fc0]
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [spigot.jar:git-Spigot-944aa20-8d16fc0]
    at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:729) [spigot.jar:git-Spigot-944aa20-8d16fc0]
    at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot.jar:git-Spigot-944aa20-8d16fc0]
    at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot.jar:git-Spigot-944aa20-8d16fc0]
    at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot.jar:git-Spigot-944aa20-8d16fc0]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal]

on right click holding player head - broken!

on right click holding player head:
   broadcast "Test"

It does not work for me anymore! Worked in 1.8 without problems!
No console errors at all.

And it works with nfells' 1.9 Skript (just tried)

There is no delay with smaller than 1 tick "wait for" times

I just spend 3 hours yesterday trying to figure out why my code doesn't work and it all came down to this:

command /testbug:
  trigger:
    set {_counter} to 1000
    loop 1000 times:
      subtract 1 from {_counter}
      wait for 0.0125 seconds
      broadcast " DEBUG: This delay should take 12,5 seconds %{_counter}%"

The issue:
If the "wait for" time is less than 1 tick there will be no delay of any kind, it's being rounded downwards to 0.

As I understand Minecraft has 20 tick cycle to execute everything in main thread. I don't know how Skript is built - perhaps it's tied up to the main thread and perhaps some things are run in their own thread the frequency of which I can only guess. But either there should be a delay smaller than 1 tick (which at the moment seems unlikely to be possible) or - in my humble opinion - the wait time should at least be rounded up to the smallest span of time that Skript is capable of waiting in the case where there is a wait time defined which is more than 0 to protect stupid users like me who do not fully understand the undocumented inner workings of Skript. I can see some possible use scenarios for a "wait for 0 ticks/seconds" which can be used to release events and keep running the rest of the code while the event has been released (but without delay).

It's hard to say from my point of view whether this is a feature (and why?) or a bug but it should probably be looked into.

If it's a feature you should probably either round upwards and/or give error/warning message when loading the skript: "the shortest amount of time you can wait is 1 ticks"

Adding to inventory of block is broken

The issue:
Adding stuff to inventory of any block that has an inventory is broken.

Version:
Latest Skript (by bensku).
Spigot version:
This server is running CraftBukkit version git-Spigot-3104eb1-daf4514 (MC: 1.9) (Implementing API version 1.9-R0.1-SNAPSHOT)

Steps to reproduce:

on right click:
  add stone to inventory of event-block

more hand/off-hand issues

on right click with iron hoe:
  event-block is grass or dirt
  cancel event
  1. Switch hoe to off-hand.
  2. Switch placable block, dirt for example, in main hand
  3. Stand on dirt/grass.
  4. Look down at your feet.
  5. Right click to place the dirt block in your hand.
  6. You can't place the dirt block because you are standing on the block where you're trying to place it.
  7. Minecraft tries to use the hoe instead.
  8. Cancel event above fails to work.

Error passing PlayerPortalEvent when returning from secondary Nether/End worlds

I hope the title makes it sort of clear, it's hard to briefly describe the situation in which this is occurring.

Basically, if you're in a Nether or End world that isn't the main one (which are named "world_nether" and 'world_the_end"), and you stand in a portal, you get this error spamming console. e.g. On my server we have a resource world which is reset monthly for fresh resources, and it has its own attached Nether and End. If someone tries to enter a Nether portal while in world "resource_nether", I get the error. Same while trying to enter the End portal in "resource_the_end".

Stack trace of error.

"doesn't have" Condition

command /addammo :
trigger:

argument 2 is "0":

  argument 1 doesn't have 1 Iron Ingot:
    send "&cNot Iron Ingot!!" to argument 1
    stop
  send "&aOK!"

Iron Ingot is having in the inventory become "No Iron Ingot !!".

ERROR code
Maybe there is no relationship........

[00:02:30 ERROR]: Could not pass event PlayerInteractEvent to Skript v2.2-Fixes-
V10
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:310) ~[spigot.jar:git-Spigot-d97e08b-880a532]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
a:62) ~[spigot.jar:git-Spigot-d97e08b-880a532]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.j
ava:502) [spigot.jar:git-Spigot-d97e08b-880a532]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
ava:487) [spigot.jar:git-Spigot-d97e08b-880a532]
at org.bukkit.craftbukkit.v1_8_R3.event.CraftEventFactory.callPlayerInte
ractEvent(CraftEventFactory.java:227) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.PlayerInteractManager.interact(PlayerInt
eractManager.java:463) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java
:759) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlo
ckPlace.java:52) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.PacketPlayInBlockPlace.a(PacketPlayInBlo
ckPlace.java:1) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:1
3) [spigot.jar:git-Spigot-d97e08b-880a532]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [
?:1.8.0_73]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_73]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar
:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:7
14) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:3
74) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:6
53) [spigot.jar:git-Spigot-d97e08b-880a532]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java
:556) [spigot.jar:git-Spigot-d97e08b-880a532]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_73]
Caused by: java.lang.NoSuchMethodError: org.bukkit.inventory.PlayerInventory.get
ItemInMainHand()Lorg/bukkit/inventory/ItemStack;
at ch.njol.skript.bukkitutil.Workarounds$1.onInteract(Workarounds.java:5
0) ~[?:?]
at sun.reflect.GeneratedMethodAccessor35.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1
.8.0_73]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_73]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.ja
va:306) ~[spigot.jar:git-Spigot-d97e08b-880a532]
... 17 more

Potions are still a bit buggy

Skript version:
dev6b

The Issue:

  1. Take potion of fire resistance in hand
on player consuming:
  broadcast " DEBUG: %tool of player%"

The output:
" DEBUG: bottle of water"

Which it isn't really. This means that there is - for now - no way of detecting whether the player has any (magical) potion in hand or just plain old water bottle.

Skript needs support for new mobs

Skript needs support for the new mobs. For example zombie and skeletal horses.

If you spawn a skeletal horse:
/summon EntityHorse ~ ~ ~ {Type:4}

on spawn:
  broadcast " DEBUG: %event-entity%"

Will give you "horse" for all the different subtypes. So if for example you wish to stop skeletal horses from spawning you cannot do it without preventing all the horses from spawning as well.

Also I'm not sure but it would seem Skript is not showing "donkey" or "mule" either when they spawn.

NoSuchMethodError at ch.njol.skript.entity.EntityData.getAll(EntityData.java:455)

Hello, I'm having an issue. When I use message "%all players%" I get an error that you probably know well.

[19:09:31 WARN]: [Skript] Task #381 for Skript v2.2-Fixes-V10 generated an exception
java.lang.NoSuchMethodError: org.bukkit.Bukkit.getOnlinePlayers()[Lorg/bukkit/entity/Player;
    at ch.njol.skript.entity.EntityData.getAll(EntityData.java:455) ~[?:?]
    at ch.njol.skript.expressions.ExprEntities.get(ExprEntities.java:146) ~[?:?]
    at ch.njol.skript.expressions.ExprEntities.get(ExprEntities.java:1) ~[?:?]
    at ch.njol.skript.lang.util.SimpleExpression.getArray(SimpleExpression.java:103) ~[?:?]
    at ch.njol.skript.lang.VariableString.toString(VariableString.java:383) ~[?:?]
    at ch.njol.skript.lang.VariableString.getArray(VariableString.java:488) ~[?:?]
    at ch.njol.skript.lang.VariableString.getArray(VariableString.java:1) ~[?:?]
    at ch.njol.skript.effects.EffMessage.execute(EffMessage.java:69) ~[?:?]
    at ch.njol.skript.lang.Effect.run(Effect.java:54) ~[?:?]
    at ch.njol.skript.command.Commands.handleEffectCommand(Commands.java:289) ~[?:?]
    at ch.njol.skript.command.Commands$4$1.call(Commands.java:222) ~[?:?]
    at ch.njol.skript.command.Commands$4$1.call(Commands.java:219) ~[?:?]
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftFuture.run(CraftFuture.java:89) ~[patched_1.9.jar:git-Paper-606]
    at org.bukkit.craftbukkit.v1_9_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:352) [patched_1.9.jar:git-Paper-606]
    at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:819) [patched_1.9.jar:git-Paper-606]
    at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:404) [patched_1.9.jar:git-Paper-606]
    at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:720) [patched_1.9.jar:git-Paper-606]
    at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:619) [patched_1.9.jar:git-Paper-606]
    at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72]

Using latest 2.2-Fixes-V10 (dev B if I understand your versioning system well :) from 4 days ago)
& PaperSpigot 1.9 generated a moment ago.

Items with no right click usage don't trigger right click events in offhand with empty mainhand

This might be an issue with Minecraft or Spigot itself. How I'm testing it is with:

on right click with diamond pickaxe on sand:
send "Hello"

If I have the diamond pick in my main hand, it works. If I have it in my offhand, and have nothing in my mainhand, it doesn't send.

This is a bit of a niche case, but just figured I'd let you know! It's otherwise working exactly as expected in regards to mainhand and offhand stuff. Thanks for these updates!

on region exit only triggers when teleporting out of region

I'm using the very latest build of both this and Spigot.

Basically title, if I walk out of a region, it's not detecting region exit events, but if I teleport out of it, it does. I'm testing via:

on region exit:
    wait 1 tick
    send "exited"

damaging players from list bugs out

Giving damage to players stored in list doesn't work:

command /test:
  trigger:
    loop players in radius 15 of location of player:
      set {_list::%UUID of loop-player%} to loop-player
    loop {_list::*}:
      damage loop-value by 0.5

Teleporting between worlds gives an error

When teleporting between two separate worlds, a stack trace appears in console saying "cannot measure distance between worlds". I think it's because of the changes in this commit. Particularly this line:

if (to.equals(from) || to.distanceSquared(from) < 2)

I don't write plugins, but looking at the Bukkit API, it looks like you'd want to change that whole section to:

if (to.equals(from))  
    return;
else if (to.getWorld() == from.getWorld())
    if (to.distanceSquared(from) < 2)
        return;

Stacktrace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.