Aller au contenu
  • 0

Can't understand this condition


Question

Posté(e)

Bonjour, 

j'ai fais un skript qui permet de compter le nombre de coffre 50 block aux alentours. Mais plusieurs probèmes semblent survenir. Je vous mets le skript et les erreurs:

on load:
	register new shapeless recipe for clock named "&7[&6Glorium]" with lore "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !" using 399, 399, 399, 397:1, diamond, 399, 397:1, diamond, gold ingot of durability 3

on right click with clock:
	if lore of tool of player is "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !":
		set {_chest} to 0
	loop all blocks in radius 50 around player:
		if loop-block is a chest:
			add 1 to {_chest}
	if loop-block is an ender chest:
		add 1 to {_chest}
	if loop-block is a trapped chest:
		add 1 to {_chest}
	if loop-block is a dropper:
		add 1 to {_chest}
	if loop-block is a dispenser:
	add 1 to {_chest}
	wait 1 tick
	set tool of player's name to "&7[&6Glorium] &8-> &b%{_chest}% coffres &8dans les &b50 &7blocks alentours"

Les erreurs:

[18:32:40] [Server thread/WARN]: [Skript] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (finder.sk, line 16: if loop-block is a dispenser:')
[18:32:40] [Server thread/ERROR]: [Skript] Can't understand this condition/effect: register new shapeless recipe for clock named "&7[&6Glorium]" with lore "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !" using 399, 399, 399, 397:1, diamond, 399, 397:1, diamond, gold ingot of durability 3 (finder.sk, line 2: register new shapeless recipe for clock named "&7[&6Glorium]" with lore "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !" using 399, 399, 399, 397:1, diamond, 399, 397:1, diamond, gold ingot of durability 3')
[18:32:40] [Server thread/ERROR]: [Skript] There's no loop that matches 'loop-block' (finder.sk, line 10: if loop-block is an ender chest:')
[18:32:40] [Server thread/ERROR]: [Skript] There's no loop that matches 'loop-block' (finder.sk, line 12: if loop-block is a trapped chest:')
[18:32:40] [Server thread/ERROR]: [Skript] There's no loop that matches 'loop-block' (finder.sk, line 14: if loop-block is a dropper:')
[18:32:40] [Server thread/ERROR]: [Skript] There's no loop that matches 'loop-block' (finder.sk, line 16: if loop-block is a dispenser:')
[18:32:40] [Server thread/WARN]: [Skript] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (propulseur.sk, line 13: if name of player's tool is "&cPropulseur":')
[18:32:40] [Server thread/WARN]: [Skript] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (propulseur.sk, line 14: if {_attentepropulseur.%player%} is less than {@attentepropulseur}:')
[18:32:40] [Server thread/WARN]: [Skript] Empty configuration section! You might want to indent one or more of the subsequent lines to make them belong to this section or remove the colon at the end of the line if you don't want this line to start a section. (propulseur.sk, line 18: else:')
[18:32:40] [Server thread/ERROR]: [Skript] 'else' has to be placed just after an 'if' or 'else if' section (propulseur.sk, line 18: else:')
[18:32:41] [Server thread/WARN]: [Skript] Using an ID instead of an alias is discouraged and will likely not be supported in future versions of Skript anymore. Please replace '401' with e.g. 'firework_rocket'. (topluck.sk, line 54: format slot 43 of player with 401 named "&a&n&lAvertir &7(x-ray)" with lore "&aSi vous clicker vous avertisser le joueur" to close then run [make console execute command "/avertissement %arg-player%"]')

 

Merci d'avance

10 réponses à cette question

Messages recommandés

  • 0
Posté(e) (modifié)

Tu as beaucoup de problème de tabulation. Après un ":" on mets tjrs une indentation. Rajoutes en une sur toutes les lignes 16 de finder.sk et 13,14,18 de propulseur.sk. Ca va déjà régler pas mal de problèmes.

Ensuite pour le problème avec le craft il te faut Skquery. Essayes d'avoir la version Lime (https://skripttools.net/dl/SkQuery-Lime+3.6.1-Lime.jar)

Et pour le loop-block jsp. J'avais déjà vu cette erreur qqpart et je sais pas d'où ça vient ?

Modifié par noftaly
  • J'aime 1
  • 0
Posté(e) (modifié)

EDIT: Noftaly a été plus rapide que moi pour le post ^^

 

Il suffit de lire et traduire la première ligne d'erreur, puis de réfléchir pour comprendre l'erreur et la résoudre !

Tu as oublié plusieurs indentations (=tabulations)

Petite astuce pour que ton code soit plus optimisé :

if loop-block is an ender chest or a chest or a dispenser or a trapped chest or a dropper:

l'erreur du loop-block et aussi dût au faite que tu n'as pas correctement respecté l'indentation (= tes loop-block sont en dehors de ta boucle)

Je ne peux que te conseiller de suivre encore quelques tutoriels sur le forum ousur  youtube afin de t'améliorer en skript. Bonne continuation

 

 

Modifié par Anarchick
  • J'aime 2
  • 0
Posté(e)

Yes je suis plus rapide ! x)

 

Et sinon pour les loop-block j'avais pas vu que c'était e dehors de la boucle x) sur tel les indentation sont cassées ?

Et aussi anarchick à raison, un or serai plus optimisé ?

  • J'aime 1
  • 0
Posté(e)

Merci je n'avais pas vu que j'avais raté des tabulations mais toujours la même erreur:

 Can't understand this condition/effect: register new shapeless recipe for clock named "&7[&6Glorium]" with lore "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !" using 399, 399, 399, 397:1, diamond, 399, 397:1, diamond, gold ingot of durability 3 (finder.sk, line 2: register new shapeless recipe for clock named "&7[&6Glorium]" with lore "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !" using 399, 399, 399, 397:1, diamond, 399, 397:1, diamond, gold ingot of durability 3')

 

  • 0
Posté(e)

@noftalyce code marche mais tu peux m'expliquer pourquoi celui ci marche mais pas l'autre.

on load:
	register new shaped recipe for clock named "&7[&6Unclaim &eFinder&7]" with lore "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !" using gold ingot, gold ingot, gold ingot, gold ingot, diamond, gold ingot, gold ingot, gold ingot, gold ingot of durability 3

on right click with clock:
	if lore of tool of player is "||&7Clique-Droit pour voir le||&7nombre de coffres dans les||&7alentours !":
		set {_chest} to 0
	loop all blocks in radius 50 around player:
		if loop-block is a chest:
			add 1 to {_chest}
		if loop-block is an ender chest:
			add 1 to {_chest}
		if loop-block is a trapped chest:
			add 1 to {_chest}
	wait 1 tick
	set tool of player's name to "&7[&6Unclaim &eFinder&7] &8-> &b%{_chest}% &8dans les &b50 &7blocks"

 

  • Humm 1
  • 0
Posté(e)
Citation

register new shaped recipe for clock named


register new shapeless recipe for clock named

shaped et shapeless sont la différence qui font l'erreur. Me demande pas pourquoi, j'ai seulement trouvé ça en comparant les 2 codes.

Invité
Ce sujet ne peut plus recevoir de nouvelles réponses.
×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.