1 votes

Existe-t-il des commandes permettant de vérifier la météo ? (1.14.4)

Je travaille sur un pack de données et je veux vérifier si le temps est rain , thunder ou clear . Est-il possible de vérifier la météo en utilisant uniquement des commandes ?

3voto

BunnyMerz Points 1286

Vous pouvez détecter s'il pleut ou s'il fait beau en utilisant des supports d'armure. Cependant, il n'y a aucun moyen de vérifier précisément si un orage est en cours. Le plus proche que j'ai vu est d'utiliser redstone dans lequel il ne détectera pas à un certain moment de la journée.

Quoi qu'il en soit, la façon dont vous voulez le détecter est ,premièrement, de créer un tableau d'affichage, dans ce cas, appelé rain :

/scoreboard objectives add rain dummy

et ensuite invoquer un stand d'armure, dans ce cas, appelé pluie avec son tag nbt feu réglé au maximum et invisible et avec "NoGravity" réglé sur vrai :

/summon minecraft:armor_stand ~ ~1 ~ {Invisible:1b,CustomName:"\"rain\"",Marker:0b,Fire:32766s,NoGravity:1v}

Voici l'ensemble de la chaîne en action :

/execute as @e[limit=1,name=rain,nbt={Fire:-1s}] at @s run scoreboard players set @s rain 3
/execute as @e[limit=1,name=rain,nbt={Fire:-1s}] at @s run data modify entity @s Fire set value 30000
/execute as @e[name=rain,scores={rain=1..}] run scoreboard players remove @s rain 1

Fondamentalement, chaque fois qu'il fonctionne, l'armorstand Fire: La balise nbt sera fixée à -1, et donc nous fixerons son score à 3 s'il correspond à la spécification et nous avons un bloc de commande qui retire 1 de son tableau de bord à tout moment. La raison pour laquelle j'ai utilisé le score au lieu des tags est que j'avais besoin d'avoir une sortie constante.

Pour utiliser la sortie pluie, il suffit de faire référence à l'entité comme @e[name=rain,scores={rain=1..}]. De même, une sortie 0 sera désignée comme claire. Je vous expliquerai plus en détail si vous le souhaitez, mais il semble que vous en sachiez assez.

2voto

Robomike Points 339

J'ai trouvé un moyen de détecter les orages. Mais il doit dépendre d'un bloc, le détecteur de lumière du jour, et il ne fonctionne que si le niveau de puissance du détecteur de lumière du jour est supérieur à deux. détecteur de lumière du jour est supérieur à 2.

Il ne fonctionne que du lever au coucher du soleil

Commencez par créer un tableau d'affichage appelé time y thunder :

/scoreboard objectives add time dummy
/scoreboard objectives add thunder dummy

Ensuite, invoquez un support d'armure avec une étiquette time y thunder . Vous pouvez certainement invoquer deux armures différentes, mais vous devez alors modifier certaines commandes.

/summon minecraft:armor_stand ~ ~ ~ {Tags:["time","thunder"]}

Ce support d'armure stockera le temps de jeu (et le score plus tard si le tonnerre est vrai). Dans un bloc de commande répétitif :

/execute as @e[tag=time] store result score @s time run time query daytime

Maintenant, placez un détecteur de lumière du jour. Ce bloc détectera l'orage.

Note : Le capteur de lumière du jour ne doit pas être bloqué par la lumière du soleil.

Note : Le détecteur de lumière du jour ne doit pas être inversé.

Le placer sur y = 254 et l'entourer de blocs-barrières devrait le rendre inaccessible aux joueurs.

Voici la chaîne de commandement pour la détection du tonnerre :

execute as @e[tag=thunder] run scoreboard players set @s thunder 0
execute as @e[tag=thunder] if entity @s[scores={time=23074..23297}] if block x y z minecraft:daylight_detector[power=2] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23298..23532}] if block x y z minecraft:daylight_detector[power=2] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23298..23532}] if block x y z minecraft:daylight_detector[power=3] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23533..23768}] if block x y z minecraft:daylight_detector[power=3] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23533..23768}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23769..23963}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23964..23999}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=23964..23999}] if block x y z minecraft:daylight_detector[power=5] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=0..170}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=0..170}] if block x y z minecraft:daylight_detector[power=5] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=171..537}] if block x y z minecraft:daylight_detector[power=5] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=171..537}] if block x y z minecraft:daylight_detector[power=6] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=538..940}] if block x y z minecraft:daylight_detector[power=6] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=941..1375}] if block x y z minecraft:daylight_detector[power=6] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=941..1375}] if block x y z minecraft:daylight_detector[power=7] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=1376..1867}] if block x y z minecraft:daylight_detector[power=7] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=1376..1867}] if block x y z minecraft:daylight_detector[power=8] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=1868..2450}] if block x y z minecraft:daylight_detector[power=8] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=2451..3175}] if block x y z minecraft:daylight_detector[power=8] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=2451..3175}] if block x y z minecraft:daylight_detector[power=9] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=3176..4301}] if block x y z minecraft:daylight_detector[power=9] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=3176..4301}] if block x y z minecraft:daylight_detector[power=10] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=4302..7707}] if block x y z minecraft:daylight_detector[power=10] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=7708..8833}] if block x y z minecraft:daylight_detector[power=10] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=7708..8833}] if block x y z minecraft:daylight_detector[power=9] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=8834..9957}] if block x y z minecraft:daylight_detector[power=9] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=8834..9957}] if block x y z minecraft:daylight_detector[power=8] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=9958..10139}] if block x y z minecraft:daylight_detector[power=8] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=10140..10632}] if block x y z minecraft:daylight_detector[power=8] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=10140..10632}] if block x y z minecraft:daylight_detector[power=7] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=10633..11067}] if block x y z minecraft:daylight_detector[power=7] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=10633..11067}] if block x y z minecraft:daylight_detector[power=6] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=11068..11469}] if block x y z minecraft:daylight_detector[power=6] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=11470..11836}] if block x y z minecraft:daylight_detector[power=6] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=11470..11836}] if block x y z minecraft:daylight_detector[power=5] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=11837..12041}] if block x y z minecraft:daylight_detector[power=5] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=11837..12041}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=12042..12238}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=12239..12474}] if block x y z minecraft:daylight_detector[power=4] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=12239..12474}] if block x y z minecraft:daylight_detector[power=3] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=12475..12708}] if block x y z minecraft:daylight_detector[power=3] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=12475..12708}] if block x y z minecraft:daylight_detector[power=2] run scoreboard players set @s thunder 1
execute as @e[tag=thunder] if entity @s[scores={time=12709..12933}] if block x y z minecraft:daylight_detector[power=2] run scoreboard players set @s thunder 1

Changement x y z avec les coordonnées de votre détecteur de lumière du jour.

La première ligne de commande fixe le score du tonnerre à 0, ce qui est faux mais est surmonté par une autre commande qui détecte le niveau de puissance du détecteur de lumière du jour pendant un certain temps du jeu. Par exemple, le temps est clair et l'heure est comprise entre 4302 et 7707. La puissance du détecteur de lumière du jour pendant cette période est de 15, mais le changement de temps modifie également le niveau de puissance du détecteur de lumière du jour et est fixé à 10.

Et pour utiliser la sortie :

execute if entity @e[tag=thunder,scores={thunder=1}] run <command>

AlleGamers.com

AlleGamers est une communauté de gamers qui cherche à élargir la connaissance des jeux vidéo.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X