Coming from bukkit 1.6.4 - A lot is broken, could use some help.

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

adam_nox

New Member
Jan 13, 2018
8
0
1
35
I hate to sound lazy, but I don't want to relearn skript from scratch, especially since most of it seems to still be intact. But I'm getting all sorts of errors and issues with my scripts taken from an older skript from a few years ago to the newest one for spigot 2.12. Here's what the console tells me:

code_language.skript:
[21:50:49 ERROR]: [Skript] There's no location in an on chunk generate event (br
idge.sk, line 26: loop blocks from block at {_loc} to block 49 blocks below bloc
k at {_loc}:')
[21:50:49 ERROR]: [Skript] Can't compare 'block 2 blocks below vehicle of player
' with an item type (cartsncombat.sk, line 71: if block 2 blocks below vehicle o
f player is air:')
[21:50:49 ERROR]: [Skript] 'else' has to be placed just after an 'if' or 'else i
f' section (cartsncombat.sk, line 77: else:')
[21:50:50 ERROR]: [Skript] the compass target of the player can't be set to 'blo
ck 128 blocks in front of player' because the latter is not a location (compass.
sk, line 10: set the player's compass target to block 128 blocks in front of pla
yer')
[21:50:52 ERROR]: [Skript] Can't compare a damage cause with a potion (custom.sk
, line 281: if damage cause is poison:')
[21:50:52 ERROR]: [Skript] Can't compare a damage cause with a potion (custom.sk
, line 367: if damage cause is poison:')
[21:50:52 ERROR]: [Skript] Can't compare a damage cause with a potion (custom.sk
, line 369: if damage cause is wither:')
[21:50:53 ERROR]: [Skript] ':8265 or potion of:16425 or potion of:8233 or potion
 of:16393 or potion of:8201 or potion of:16457' is not a valid item data (custom
.sk, line 625: if tool is potion of:8265 or potion of:16425 or potion of:8233 or
 potion of:16393 or potion of:8201 or potion of:16457:')
[21:50:53 ERROR]: [Skript] ':8265 or potion of:16425 or potion of:8233 or potion
 of:16393 or potion of:8201 or potion of:16457' is not a valid item data (custom
.sk, line 629: if item is potion of:8265 or potion of:16425 or potion of:8233 or
 potion of:16393 or potion of:8201 or potion of:16457:')
[21:50:53 ERROR]: [Skript] can't understand this event: 'on consume potion' (cus
tom.sk, line 632: on consume potion:')
[21:50:53 ERROR]: [Skript] There's no loop that matches 'loop-entity' (custom.sk
, line 739: loop-entity exists')
[21:50:55 WARN]: [Skript] Possible name conflict of variables {deathchest::%loop
-index%} and {deathchest::*} (there might be more conflicts). (deathchest.sk, li
ne 29: clear {deathchest::%loop-index%}')
[21:50:55 WARN]: [Skript] Starting a variable's name with an expression is disco
uraged ({%arg 1%::*}). You could prefix it with the script's name: {dragon.%arg
1%::*} (dragon.sk, line 16: clear {%arg 1%::*}')
[21:50:55 WARN]: [Skript] Possible name conflict of variables {%arg 1%::*} and {
dragonspawn::*} (there might be more conflicts). (dragon.sk, line 16: clear {%ar
g 1%::*}')
[21:50:55 ERROR]: [Skript] Can't understand this expression: 'block 10 blocks ab
ove targeted block' (dragon.sk, line 109: set {_loc} to block 10 blocks above ta
rgeted block')
[21:50:55 ERROR]: [Skript] There are multiple loops that match loop-value. Use l
oop-value-1/2/3/etc. to specify which loop's value you want. (dragon.sk, line 18
1: distance between loop-entity and loop-value is greater than {_dist}:')
[21:50:55 WARN]: [Skript] Possible name conflict of variables {blocks::*} and {%
arg 1%::*} (there might be more conflicts). (earth.sk, line 37: add location of
loop-block to {_blocks::*}')
[21:50:55 ERROR]: [Skript] Can't understand this expression: 'the block 2 blocks
 above the targeted entity' (earth.sk, line 63: set {_yloc3} to the block 2 bloc
ks above the targeted entity')
[21:50:55 ERROR]: [Skript] Can't understand this expression: 'the block 3 blocks
 above the targeted entity' (earth.sk, line 64: set {_yloc4} to the block 3 bloc
ks above the targeted entity')
[21:50:55 ERROR]: [Skript] Can't understand this expression: 'the block 4 blocks
 above the targeted entity' (earth.sk, line 65: set {_yloc5} to the block 4 bloc
ks above the targeted entity')
[21:50:55 ERROR]: [Skript] Can't understand this expression: 'the block 5 blocks
 above the targeted entity' (earth.sk, line 66: set {_yloc6} to the block 5 bloc
ks above the targeted entity')
[21:50:55 ERROR]: [Skript] There are multiple loops that match loop-value. Use l
oop-value-1/2/3/etc. to specify which loop's value you want. (earth.sk, line 123
: distance between location of event-block and block at loop-value is less than
3:')
[21:50:55 ERROR]: [Skript] There are multiple loops that match loop-value. Use l
oop-value-1/2/3/etc. to specify which loop's value you want. (earth.sk, line 130
: distance between event-block and block at loop-value is less than 3:')
[21:50:56 ERROR]: [Skript] Can't compare 'block 8 blocks above targeted entity'
with an item type (earth.sk, line 223: block 8 blocks above targeted entity is n
ot air:')
[21:50:56 ERROR]: [Skript] Can't understand this condition/effect: set block 8 b
locks above targeted entity to anvil (earth.sk, line 230: set block 8 blocks abo
ve targeted entity to anvil')
[21:50:56 ERROR]: [Skript] There's no loop that matches 'loop-player' (earth.sk,
 line 463: execute console command "/playsound ambient.weather.rain %loop-player
%"')
[21:50:57 ERROR]: [Skript] loop-block is not a direction (earth.sk, line 652: th
e block 2 blocks above loop-block is air')
[21:50:57 ERROR]: [Skript] the loop-block is not a direction (earth.sk, line 654
: set {_rezloc} to the location 2 blocks above the loop-block')
[21:50:57 WARN]: [Skript] an entity cannot be saved, i.e. the contents of the va
riable {lastdeath} will be lost when the server stops. (earth.sk, line 675: set
{lastdeath} to victim')

Some of the potion stuff refers to plugins I can't find updated versions of, so they can be ignored. About half the errors would be fixed if I knew what it wanted in order to reference a location such as "block 8 blocks above targeted entity". And yes :emoji_stuck_out_tongue: , this all did work at one time, with maybe 1 error and 1 or 2 warnings.

"damage cause is wither" also used to work. Is it damage type now? It used to be a damage type, not just a potion.

and "loop-block isn't a direction"? This is making my head hurt. The word that comes after "above" is going to be an object, in english, in anything. Not a direction.

And from playing I have a suspicion there's a decent amount non-functional that isn't showing up as errors. I've attached all my scripts.

Thanks for any help.
 

Attachments

  • scripts.zip
    25.5 KB · Views: 239
Last edited:
Maybe could you tell me which addons do you have isntalled and which version of skript? (/ver skript)
 
Maybe could you tell me which addons do you have isntalled and which version of skript? (/ver skript)

2.2-dev32d

localthunder (not working, won't load)
PowerNBT (unsure of status, no errors though)
mcMMO
MythicDrops
terraincontrol
Vault 1.6.1 (though skript apparently doesn't like it.)
xpmultiplier (again not sure on status, if it has any effect on this version of spigot)
 
Uhm, do you don't have any Addons?`This is why you getting a lot errors.

You may need:
-SkRayFall
-SkQuery
-TuSKe (Optinal) (i didn't read the whole errors)
-Skellett (Potions i belive)
-MundoSK (Maybe)
 
For the “5 blocks above whatever” use ‘meters’ instead of blocks

For the damage cause check the docs to make sure you’re using the right names, if you are then just throw it in quotes and check “%damage cause%”

For the ones complaining about loops it usually fixes it if you use loop-value instead of say loop-player, loop-entity, etc

The warnings you can usually safely ignore
 
For the “5 blocks above whatever” use ‘meters’ instead of blocks

For the damage cause check the docs to make sure you’re using the right names, if you are then just throw it in quotes and check “%damage cause%”

For the ones complaining about loops it usually fixes it if you use loop-value instead of say loop-player, loop-entity, etc

The warnings you can usually safely ignore

Thanks, making changes now.

Do you know how to resolve the chunk generate "no location" error?

Also the else complaint. The code looks like this:

code_language.skript:
        while player is riding a minecart:
            loop 10 times:
                wait 2 ticks
                {rocket.%player%} is "yes":
                    if block 2 meters below vehicle of player is air:
                        block below vehicle of the player is air
                        block east of vehicle of the player is air
                        block west of vehicle of the player is air
                        block in front of vehicle of the player is air
                        push vehicle of the player down at speed 0.1
                    else:
                        push vehicle of the player up at speed 0.1
                    if block in front of vehicle of the player is not air:
                        push vehicle of the player up at speed 0.1
                    else if block west of vehicle of the player is not air:
                        push vehicle of the player up at speed 0.1
                    else if block east of vehicle of the player is not air:
                        push vehicle of the player up at speed 0.1
                    push the vehicle of the player in the direction of player at speed 0.15

Also, what's the replacement for "on consume potion" (I can prob figure that out but throwing it in here)

I don't have a base trigger set up for "if riding a cart" (I don't know what it would actually be). But something gets tripped when I get in a cart now and I'm instantly ejected from the cart (one time resulting in a hilarious death). Attempts to rename a mob on damage seem to be failing now without console errors, and a couple other things.

Thank you very much for your help. I will report back by editing this post in a couple minutes.

Update: Okay not sure how to fix this ( There's no loop that matches 'loop-entity'), it's to stop drops from getting destroyed by burning.

code_language.skript:
on ignition:
    loop all dropped items in radius 1 around event-entity's location:
        loop-entity exists
        #broadcast "it burns!"
        cancel the event
    if event-entity is a dropped item:
        cancel the event

This code is getting the complaint that there are multiple loop-values. I don't think there are:

code_language.skript:
on spread:
    {water} is 1:
        cancel the event
    loop all players:
        loop {radblocks.%loop-player%::*}:
            distance between location of event-block and block at loop-value is less than 3:
                cancel the event

I think maybe if I just appended -1 to loop-value it might work, but the error might also indicate a deeper issue with its understanding of what I'm trying to do, so not sure.

This says there's no loop that matches %loop-player%:

code_language.skript:
    loop all players in radius 16 of the block at the player's location:
        execute console command "/playsound ambient.weather.rain %loop-player%"

The meters replacement got rid of those "blocks above/below/etc" though, thanks.
[doublepost=1515864986,1515861767][/doublepost]
For the damage cause check the docs to make sure you’re using the right names, if you are then just throw it in quotes and check “%damage cause%”

Okay, am not completely sure I understand your suggestion. Here's the line of code:

if damage cause is poison:

How would I modify that?

if "%damage cause%" is "poison":

Like that?
[doublepost=1515866967][/doublepost]another edit:

Looks like the multiple loop complaints are valid despite not appearing in earlier versions, due to loop nesting. I'm using loop-value for the results of stored variables, maybe I should use another term, but not sure what. But I think I can fix the code either way.
 
can you send chunk generate code

you might need skquery for the else problem because it reloads without errors for me. as chislelp skquery, skellet, skrayfall, and tuske are very useful addons

yes, thats what i meant for the damage cause

like you said when having nested loops you gotta specify which one youre referring to
code_language.skript:
loop all players:
    loop {radblocks.%loop-value%::*}:
        distance between location of event-block and block at loop-value-2 is less than 3:
           cancel the event

i would recommend always using loop-value and letting skript sort it out for you so it doesnt yell at you
code_language.skript:
loop all players in radius 16 of the block at the player's location:
    execute console command "/playsound ambient.weather.rain %loop-value%"
 
Thanks, both the chunk generate and else error went away. I think maybe it has to do with variable generation that other errors were messing with? I honestly don't know at this point. But if you would indulge me, and I will try to research what is wrong with my syntax, I have code that is supposed to update the name of a mob on damage and send damage numbers to nearby players, and neither is working. Maybe you could take a look at the following (forgive me if it looks very sloppy) and tell me what might be going on.

code_language.skript:
on damage of living entity:
    #if victim is not a wolf or an ocelot or a horse or a pig or a sheep or a cow or a chicken or a player or a villager or a mooshroom or a squid or bat:
    if victim is an enderman or a zombie pigman or a creeper or a zombie or a skeleton or a spider or a silverfish or a slime or a cave spider or witch or ender dragon:
        if damage cause is suffocation or drowning:
            {suffcaster} is set
            set damage to damage*({suffcaster}*1.5)
            loop all players in radius 24 of victim:
                {combat.%loop-player%} is 1
                send "&9%victim% takes %damage*2% suffocation damage" to loop-player
            clear {suffcaster}
        if damage is caused by block explosion:
            {exploder} is set
            #broadcast "set"
            set damage to damage+({exploder}*0.8)
            clear {exploder}
        if damage cause is entity explosion:
            if {exploder} is set:
                set damage to damage+({exploder}*0.8)
                clear {exploder}
        if damage cause is falling block:
            {dropper} is set
            set damage to 5+({dropper}*1)
            #clear {dropper}
        if damage cause is fall:
            {slammer} is set
            set damage to 5+({slammer}*1)
            clear {slammer}
        if projectile is a fireball:
            shooter is a player
            set damage to 1+({power.%shooter%}*0.5)
            #create safe explosion of force 0 at victim's location
            #ignite victim
        if projectile is an arrow:
            shooter is a player
            set damage to damage+({spd.%attacker%}*0.4)
            if {sneak.%attacker%} is "yes":
                distance between attacker and victim is less than 9
                set damage to damage*2
                send "&cSNEAK ATTACK!"
            if {atks.%attacker%} is not set:
                set {atks.%attacker%} to 0
            if {atks.%attacker%} is less than 3:
                if {timer.%attacker%} is not set:
                    set {timer.%attacker%} to now
                if difference between {timer.%attacker%} and now is greater than 5 ticks:
                    add 1 to {atks.%attacker%}
                    set {timer.%attacker%} to now
                    send "&7%{atks.%attacker%}% combo points ready and +%5*{atks.%attacker%}%%% to damage." to attacker
            set damage to damage+(damage*({atks.%attacker%}*0.05))
        if "%damage cause%" is "poison":
            set damage to damage+(damage*({spd.%attacker%}*0.1))
        if "%damage cause%" is "wither":
            if {wither} is greater than 0:
                set damage to damage+(damage*({wither}*0.15))
                subtract ({wither}*0.2) from {wither}
            else:
                set damage to damage+(damage*({bal.%attacker%}*0.005))
        set {_maxhp} to victim's maximum health
        set {_lvl} to ceil(({_maxhp}-10)*0.2)
        if {_lvl} is less than 1:
            set {_lvl} to 1
        if damage is caused by thorns:
            set damage to damage+(damage*({_lvl}*0.5))
        if projectile is a snowball:
            shooter is a player
            shooter's held item is a snowball or empty
            if name of shooter's held item does not contain "&a[Spirit]":
                set damage to 0.5+({bal.%shooter%}*0.05)
        loop all players in radius 24 of victim:
            damage cause is not fire or lava or burning or suffocation
            if {combat.%loop-player%} is 1:
                send "&9%victim% takes %ceil(damage*2)% %damage cause% damage" to loop-player
        if damage is greater than 0.5:
            set the victim's name to "&eLVL:&f%ceil({_lvl})% &cHP:&f%ceil((victim's health)*2)%"
        if damage cause is burning or fire:
            #sunlight level at victim is 15
            #time in "world" is day
            set {_dmg} to damage+(damage*({_lvl}*0.25))
            if {firestarter} is set:
                set {_dmg} to {_dmg}+({firestarter}*0.15)
            set damage to {_dmg}
        if attacker is iron golem:
            set damage to damage+(damage*({_lvl}*0.5))
        if damage cause is attack:
            attacker is a player:
                if {atks.%attacker%} is not set:
                    set {atks.%attacker%} to 0
                if {atks.%attacker%} is less than 3:
                    if {timer.%attacker%} is not set:
                        set {timer.%attacker%} to now
                    if difference between {timer.%attacker%} and now is greater than 5 ticks:
                        add 1 to {atks.%attacker%}
                        set {timer.%attacker%} to now
                        send "&7%{atks.%attacker%}% combo points ready and +%5*{atks.%attacker%}%%% to damage." to attacker
                set damage to damage+(damage*({atks.%attacker%}*0.05))
            if {sneak.%attacker%} is "yes":
                set damage to damage*3
                send "&cSNEAK ATTACK!" to attacker

Same with damage to a player, probably related.
 
No console errors. Just doesn't do anything in game when an enemy is damaged. Their name is set, I've gotten messages, so I feel like maybe the trigger is the problem or the if statement after, maybe enemies are referenced differently?
 
yup the if statement isn't catching it, maybe mob names are different. Wonder if there's a simpler way to do this. Thanks again. Going to consider this general topic resolved since the errors are gone.

Thanks!