Bulundu world dünyasında buğday kırma

Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

growning

Bir Kömür Göründü Kaptanım!
Katılım
19 Haziran 2020
Mesajlar
117
Elmaslar
13
Puan
13.605
Yaş
26
Minecraft
growning

Discord:

growning

Merhaba ben world dünyasında spawnın altında bir yere tarla yaptım.
resimdeki alan komple buğday ekilecek ve oyuncuların kırmasına izin verilecek
Tarım Bölgesinde buğdaylar 3 dakikada bir yenilenmesi lazım buğday kırarken yüzde 7 ihtimalle elle tutulan tarım coin çıkacak (köylü takasta kullanılacak)

2025-01-23_18.13.25.webp
 
Worldguard üstünden öncelik değeri spawn bölgesinden daha yüksek bir bölge ile tarım yaptığınız bölgedeki blok kırma izinleri harici tüm eylemleri yasaklayın.

Ardından mineresetlite vb pluginler ile buğday bölgesi oluşturun ve belirlediğiniz sürede kırılmasını sağlayın.

Skript ile belli bölgede olan kişilerin belli şanslar ile coin düşünmesini sağlayabilirsiniz.
 
Python:
import:
    eu.decentsoftware.holograms.api.DHAPI
    eu.decentsoftware.holograms.api.holograms.Hologram

    java.util.List
    java.util.ArrayList
    java.util.Collection


options:
    world: world "world"


on unload:
    loop {brokenWheats::*}:
        set block at loop-value to ripe wheat plant
        DHAPI.removeHologram(loop-index)
        delete {brokenWheats::%loop-index%}
   
    delete {brokenWheats::*}


on break:
    if {brokenWheats::farmland::*} contains event-block:
        cancel event
        stop
    if {brokenWheats::*} contains event-block:
        cancel event
        stop
    if event-block is a ripe wheat plant:
        wheatBreak(event-block)
       


local function wheatBreak(block: block):
    if world of location of {_block} is {@world}:
        set {_id} to size of {brokenWheats::*} + 1
        set {brokenWheats::%{_id}%} to {_block}
        set {brokenWheats::time::%{_id}%} to 180 # süre

        set {brokenWheats::farmland::%{_id}%} to block under {_block}
       
        set {_hloc} to location of {_block}
        add 0.77 to y-coord of {_hloc}
       
        set {_lines} to new ArrayList()
        {_lines}.add("")

        DHAPI.createHologram("%{_id}%", {_hloc}, false, {_lines})

        updateWheatTime({_id})
        wait a tick
        set block at {_block} to wheat item


local function updateWheatTime(id: int):
    while {brokenWheats::%{_id}%} is set:
       
        set {_holo} to DHAPI.getHologram("%{_id}%")
        set {_page} to DHAPI.getHologramPage({_holo}, 0)
        set {_hololine} to DHAPI.getHologramLine({_page}, 0)
        DHAPI.setHologramLine({_hololine}, "<#40ff00>%getFormattedTime({brokenWheats::time::%{_id}%})%")

        wait a second
        remove 1 from {brokenWheats::time::%{_id}%}
        if {brokenWheats::time::%{_id}%} <= 0:
            set block at {brokenWheats::%{_id}%} to ripe wheat plant
            DHAPI.removeHologram("%{_id}%")
            delete {brokenWheats::farmland::%{_id}%}
            delete {brokenWheats::%{_id}%}
           

    DHAPI.removeHologram("%{_id}%")



local function getFormattedTime(t: int) :: string:
    set {_minutes} to floor({_t} / 60)
    set {_seconds} to mod({_t}, 60)

    # Eğer dakika tek haneliyse başına 0 ekle
    set {_formattedMinutes} to "%{_minutes}%"
    if {_minutes} < 10:
        set {_formattedMinutes} to "0%{_minutes}%"

    # Eğer saniye tek haneliyse başına 0 ekle
    set {_formattedSeconds} to "%{_seconds}%"
    if {_seconds} < 10:
        set {_formattedSeconds} to "0%{_seconds}%"

    set {_time} to "%{_formattedMinutes}%:%{_formattedSeconds}%"

    return {_time}

Skript 2.9.5 ile test edildi.
Gereksinimler:
DECENTHOLOGRAMS
Skript-Reflect



Koda dediğin her şeyi koyamadım zamanım yetmedi.

Discord'dan yazarsan ayarlarız: 0mustafa.
 
Durum
Üzgünüz bu konu cevaplar için kapatılmıştır...

Hala Discord sunucumuza katılmadın mı?

Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!

Şimdi Katıl