# /adafly komutu ile açıp kapatabilirler
command /adafly:
trigger:
if {adafly::%player%} is not set:
set {adafly::%player%} to true
send "&aAdaFly modun aktif edildi!"
set player's flight mode to true
else:
delete {adafly::%player%}
send "&cAdaFly modun kapatıldı!"
set player's flight mode to false
# Oyuncu hareket ettiğinde kontrol et
on any move:
if {adafly::%player%} is true:
# Oyuncunun bulunduğu konumun tam altındaki bloğu kontrol et
# 1.8.9'da "loop blocks under player" bazen takılabilir, bu yüzden direkt koordinat kontrolü en iyisidir.
set {_x} to 0
set {_check} to false
# Oyuncunun altından haritanın en altına (0. kata) kadar olan blokları tara
loop blocks under player:
if loop-block is not air:
set {_check} to true
stop loop
# Eğer aşağıda hiç blok yoksa (tamamen hava ise) uçuşu kapat
if {_check} is false:
set player's flight mode to false
send "&cAltın boş olduğu için uçuş modun kapatıldı!" to player
delete {adafly::%player%}
else:
# Eğer blok varsa ve uçuşu kapalıysa tekrar aç (Adaya geri döndüğünde)
if player's flight mode is false:
set player's flight mode to true
# Oyuncu oyundan çıkarsa veriyi temizle (Bug olmaması için)
on quit:
delete {adafly::%player%}