problème avec skript sur un plugin

Renan_

Aventurier
10 Février 2025
4
0
1
24
bonjour, j'ai un problème avec mon script sk qui ne marche pas. voici le script, si quelqu'un pouvait m'aider merci d'avance.

Code:
options:
    fire_gem: fire gem
    speed_gem: speed gem
    astra_gem: astra gem
    golden_gem: golden gem
    life_gem: life gem
    puff_gem: puff gem
    str_gem: str gem
    wealth_gem: wealth gem
on first join:
    set {gem.%player%} to true
    give player 1 {@fire_gem}
    give player 1 {@speed_gem}
    give player 1 {@astra_gem}
    give player 1 {@golden_gem}
    give player 1 {@life_gem}
    give player 1 {@puff_gem}
    give player 1 {@str_gem}
    give player 1 {@wealth_gem}
on join:
    if {gem.%player%} is not set:
        set {gem.%player%} to true
        give player 1 {@fire_gem}
        give player 1 {@speed_gem}
        give player 1 {@astra_gem}
        give player 1 {@golden_gem}
        give player 1 {@life_gem}
        give player 1 {@puff_gem}
        give player 1 {@str_gem}
        give player 1 {@wealth_gem}
    else:
        wait 1 tick
        loop all items in player's inventory:
            if loop-item is {@fire_gem}:
                add 1 to {has_fire.%player%}
            if loop-item is {@speed_gem}:
                add 1 to {has_speed.%player%}
            if loop-item is {@astra_gem}:
                add 1 to {has_astra.%player%}
            if loop-item is {@golden_gem}:
                add 1 to {has_golden.%player%}
            if loop-item is {@life_gem}:
                add 1 to {has_life.%player%}
            if loop-item is {@puff_gem}:
                add 1 to {has_puff.%player%}
            if loop-item is {@str_gem}:
                add 1 to {has_str.%player%}
            if loop-item is {@wealth_gem}:
                add 1 to {has_wealth.%player%}
        if {has_fire.%player%} is 0:
            give player 1 {@fire_gem}
        if {has_speed.%player%} is 0:
            give player 1 {@speed_gem}
        if {has_astra.%player%} is 0:
            give player 1 {@astra_gem}
        if {has_golden.%player%} is 0:
            give player 1 {@golden_gem}
        if {has_life.%player%} is 0:
            give player 1 {@life_gem}
        if {has_puff.%player%} is 0:
            give player 1 {@puff_gem}
        if {has_str.%player%} is 0:
            give player 1 {@str_gem}
        if {has_wealth.%player%} is 0:
            give player 1 {@wealth_gem}
on death:
    loop all items in player's inventory:
        if loop-item is {@fire_gem} or {@speed_gem} or {@astra_gem} or {@golden_gem} or {@life_gem} or {@puff_gem} or {@str_gem} or {@wealth_gem}:
            set {death_%loop-item%.%player%} to true
    wait 1 tick
    loop all blocks in radius 5 around death location:
        if loop-block is chest:
            loop all items in loop-block's inventory:
                if loop-item is {@fire_gem} or {@speed_gem} or {@astra_gem} or {@golden_gem} or {@life_gem} or {@puff_gem} or {@str_gem} or {@wealth_gem}:
                    set {stored_%loop-item%_%player%} to true
    loop {death_%loop-item%.%player%}:
        give player 1 loop-index
        delete {death_%loop-item%.%player%}
on drop:
    if event-item is {@fire_gem} or {@speed_gem} or {@astra_gem} or {@golden_gem} or {@life_gem} or {@puff_gem} or {@str_gem} or {@wealth_gem}:
        cancel event
 
Dernière édition:
Bonsoir,

Pourrais-tu modifier ton message initial pour mettre des blocs de code ``` plutôt qu'un bloc de citation, histoire de conserver l'indentation ?

Aussi, tu n'as pas dit ce qui ne marchait pas. Si tu as un message d'erreur, il faudrait le recopier.

Cordialement,
ShE3py
 
Code:
[17:51:28] [Server thread/INFO]: Line 13: (Gem_SMP.sk)
[17:51:28] [Server thread/INFO]: '1 fire_charge' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:28] [Server thread/INFO]: Line: give player 1 {@fire_gem}
[17:51:28] [Server thread/INFO]:
[17:51:28] [Server thread/INFO]: Line 15: (Gem_SMP.sk)
[17:51:28] [Server thread/INFO]: '1 nether_star' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:28] [Server thread/INFO]: Line: give player 1 {@astra_gem}
[17:51:28] [Server thread/INFO]:
[17:51:28] [Server thread/INFO]: Line 16: (Gem_SMP.sk)
[17:51:28] [Server thread/INFO]: '1 gold_ingot' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:28] [Server thread/INFO]: Line: give player 1 {@golden_gem}
[17:51:28] [Server thread/INFO]:
[17:51:28] [Server thread/INFO]: Line 17: (Gem_SMP.sk)
[17:51:28] [Server thread/INFO]: '1 heart_of_the_sea' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:28] [Server thread/INFO]: Line: give player 1 {@life_gem}
[17:51:28] [Server thread/INFO]:
[17:51:28] [Server thread/INFO]: Line 18: (Gem_SMP.sk)
[17:51:28] [Server thread/INFO]: '1 netherite_sword' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:28] [Server thread/INFO]: Line: give player 1 {@puff_gem}
[17:51:28] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 19: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 blaze_powder' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@str_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 25: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 fire_charge' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@fire_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 27: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 nether_star' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@astra_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 28: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 gold_ingot' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@golden_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 29: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 heart_of_the_sea' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@life_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 30: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 netherite_sword' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@puff_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 31: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 blaze_powder' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@str_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 36: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't compare a slot with 'fire_charge'
[17:51:29] [Server thread/INFO]: Line: if loop-item is {@fire_gem}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 40: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't compare a slot with 'nether_star'
[17:51:29] [Server thread/INFO]: Line: if loop-item is {@astra_gem}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 42: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't compare a slot with 'gold_ingot'
[17:51:29] [Server thread/INFO]: Line: if loop-item is {@golden_gem}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 44: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't compare a slot with 'heart_of_the_sea'
[17:51:29] [Server thread/INFO]: Line: if loop-item is {@life_gem}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 46: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't compare a slot with 'netherite_sword'
[17:51:29] [Server thread/INFO]: Line: if loop-item is {@puff_gem}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 48: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't compare a slot with 'blaze_powder'
[17:51:29] [Server thread/INFO]: Line: if loop-item is {@str_gem}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 53: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 fire_charge' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@fire_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 57: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 nether_star' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@astra_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 59: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 gold_ingot' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@golden_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 61: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 heart_of_the_sea' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@life_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 63: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 netherite_sword' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@puff_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 65: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: '1 blaze_powder' can't be added to a player because the former is neither an item type, an inventory nor an experience point
[17:51:29] [Server thread/INFO]: Line: give player 1 {@str_gem}
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 70: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Use 'attacker' and/or 'victim' in damage/death events
[17:51:29] [Server thread/INFO]: Line: loop all items in player's inventory:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 74: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't understand this loop: 'all blocks in radius 5 around death location'
[17:51:29] [Server thread/INFO]: Line: loop all blocks in radius 5 around death location:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 79: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: There's no loop that matches 'loop-item'
[17:51:29] [Server thread/INFO]: Line: loop {death_%loop-item%.%player%}:
[17:51:29] [Server thread/INFO]:
[17:51:29] [Server thread/INFO]: Line 84: (Gem_SMP.sk)
[17:51:29] [Server thread/INFO]: Can't understand this condition: 'event-item is fire_charge or feather or nether_star or gold_ingot or heart_of_the_sea or netherite_sword or blaze_powder or emerald'
[17:51:29] [Server thread/INFO]: Line: if event-item is {@fire_gem} or {@speed_gem} or {@astra_gem} or {@golden_gem} or {@life_gem} or {@puff_gem} or {@str_gem} or {@wealth_gem}:
[17:51:29] [Server thread/INFO]:



voici l'erreur
 
Dernière édition:
Pareillement pour les erreurs, c'est plus lisible si tu les mets entre triples accents graves ```.

Et avant de t'embêter avec plusieurs gemmes tu peux déjà essayer de faire fonctionne une seule gemme ; là l'erreur est que tu essayes de donner une “fire gem”, mais cet item n'existe pas. Tu veux probablement faire quelque chose comme ça :
Code:
give player diamond named "Ma gemme"
E.g. le programme ne peut pas deviner quel item il doit donner si tu ne lui dis pas.
 
je comprend mais mon objectif est de créer des items (les options en haut c'était un test) si ce n'est juste pas possible dit le moi. merci d'avance.
 
Dernière édition:
Tu ne peux pas créer de nouvel item a strictement parler ; tu peux en revanche modifier la texture et le comportement d'un item vanilla. Selon ta version du jeu, cela ne remplacera pas l'item vanilla (la technique consiste à donner des items inobtenables normalement, e.g. incassable).
 
Dernière édition: