Maarfum Posté(e) le 31 janvier 2016 Posté(e) le 31 janvier 2016 Hello, j'aimerais savoir quel est le code pour verifier si le joueur est full dans sa "hunger" Exemple: on right click holding a bread: # Verifier si le joueur a besoin de manger ou non apply saturation 1 to player for 1 seconds remove 1 of tool from tool play raw sound "random.eat" at player with pitch 1 volume 1 Je pense que c'est une ligne du genre.. if player's health is not equal to player's max health:
mantalo35 Posté(e) le 1 février 2016 Posté(e) le 1 février 2016 C player'hunger pas player's health Tu veut vérifier la bouf ou la vie ?
Maarfum Posté(e) le 1 février 2016 Auteur Posté(e) le 1 février 2016 if player's hunger is not equal to player's max hunger: Ne fonctionne pas, voici l'erreur: http://www.noelshack.com/2016-05-1454311966-sans-titre-1.png
Maarfum Posté(e) le 1 février 2016 Auteur Posté(e) le 1 février 2016 J'ai trouvé ceci, mais c'est trop long :/ on right click holding a bread: if player's hunger = 0: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 0.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 1: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 1.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 2: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 2.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 3: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 3.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 4: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 4.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 5.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 6: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 6.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 7: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 7.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 8: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 8.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 9: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player on right click holding a bread: if player's hunger = 9.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player
Nutet Posté(e) le 1 février 2016 Posté(e) le 1 février 2016 Sinon beaucoup plus simple ;) : on right click holding a bread: if player's hunger <= 9.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player Cette alternative résume tout ce que tu as noté avant :) 2
Maarfum Posté(e) le 2 février 2016 Auteur Posté(e) le 2 février 2016 Sinon beaucoup plus simple ;) : on right click holding a bread: if player's hunger <= 9.5: cancel event remove 1 of tool from tool apply saturation 1 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 1 tick remove saturation from player Cette alternative résume tout ce que tu as noté avant :) Merci à toi, mais j'ai mis dans un seul monde sauf que je peut le faire dans n'importe quel monde :/ on right click holding a bread: if player is in "island-0": if player's hunger <= 9.5: cancel event remove 1 of tool from tool apply saturation 4 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 2 tick remove saturation from player
kumakuma215 Posté(e) le 2 février 2016 Posté(e) le 2 février 2016 Merci à toi, mais j'ai mis dans un seul monde sauf que je peut le faire dans n'importe quel monde :/ on right click holding a bread: if player is in "island-0": if player's hunger <= 9.5: cancel event remove 1 of tool from tool apply saturation 4 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 2 tick remove saturation from player Tu dois mettre une tabulation après la ligne de ta condition de verification du monde ^^. 1
Nutet Posté(e) le 2 février 2016 Posté(e) le 2 février 2016 Comme l'a dit kumakuma215 tu dois mettre des tabulations après une condition ce qui donnerait ceci : on right click holding a bread: if player is in "island-0": if player's hunger <= 9.5: cancel event remove 1 of tool from tool apply saturation 4 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 2 tick remove saturation from player Et si la ligne ' if player is in "island-0": ' ne marche toujours pas mais cela m'étonnerait, remplace la par ' if player's world is "island-o": ' ;)
Maarfum Posté(e) le 2 février 2016 Auteur Posté(e) le 2 février 2016 Comme l'a dit kumakuma215 tu dois mettre des tabulations après une condition ce qui donnerait ceci : on right click holding a bread: if player is in "island-0": if player's hunger <= 9.5: cancel event remove 1 of tool from tool apply saturation 4 to player for 0.5 seconds play raw sound "random.eat" at player with pitch 1 volume 1 wait 2 tick remove saturation from player Et si la ligne ' if player is in "island-0": ' ne marche toujours pas mais cela m'étonnerait, remplace la par ' if player's world is "island-o": ' ;) Effectivement, j'avais oublié un tab >< Merci.
Messages recommandés