event-block is not a date (help still needed)

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

oHeckGage

Active Member
Mar 24, 2020
110
6
18
22
Code:
on place:
    if event-block is a composter:
        loop all blocks in radius of 5 from event-block:
            if loop-block is fully grown wheat plant:
                wait 4 seconds
                set loop-block to air
                loop all blocks in radius of 5 of loop-block:
                    if loop-block is chest:
                        add 2 wheat into inventory
            if loop-block is fully grown carrot plant:
                wait 4 seconds
                set loop-block to air
                loop all blocks in radius of 5 of loop-block:
                    if loop-block is chest:
                        add 2 wheat into inventory
            if loop-block is fully grown potato plant:
                wait 4 seconds
                set loop-block to air
                loop all blocks in radius of 5 of loop-block:
                    if loop-block is chest:
                        add 2 wheat into inventory

So I want to make an auto harvester and on line 3 it says that event-block is not a date. What I want it to do is loop all the blocks in a radius of 5 from event-block
 
Code:
on place:
    if event-block is a composter:
        loop all blocks in radius of 5 from event-block:
            if loop-block is fully grown wheat plant:
                wait 4 seconds
                set loop-block to air
                loop all blocks in radius of 5 of loop-block:
                    if loop-block is chest:
                        add 2 wheat into inventory
            if loop-block is fully grown carrot plant:
                wait 4 seconds
                set loop-block to air
                loop all blocks in radius of 5 of loop-block:
                    if loop-block is chest:
                        add 2 wheat into inventory
            if loop-block is fully grown potato plant:
                wait 4 seconds
                set loop-block to air
                loop all blocks in radius of 5 of loop-block:
                    if loop-block is chest:
                        add 2 wheat into inventory

So I want to make an auto harvester and on line 3 it says that event-block is not a date. What I want it to do is loop all the blocks in a radius of 5 from event-block
Remove the 'of' in line 3 (loop all blocks in radius of 5 from event-block)
And replace 'from' with 'around'
 
Remove the 'of' in line 3 (loop all blocks in radius of 5 from event-block)
And replace 'from' with 'around'

Doesn't work still

Error:
Can't understand this loop: 'loop all blocks in a radius of 5 around event-block'
 
Current code, skript version, MC version

Code:
every 2 seconds in world "season2":
    loop all blocks:
        if loop-block-1 is a composter:
            set {autoharvcomp} to {_loc} of loop-block
            loop all blocks in radius 5 around {autoharvcomp}:
                if loop-block-2 is fully grown wheat plant:
                    set block at loop-block-2 to freshly planted wheat plant
                    loop all blocks in radius 5 around {autoharvcomp}:
                        if loop-block-3 is chest:
                            set {autoharvchest} to block at loop-block-3
                            add 2 wheat to {autoharvchest}'s inventory

I tried going at a different approach and it shows no errors but doesn't work
 
What's this? That doesn't make sense
set {autoharvcomp} to {_loc} of loop-block
 
What are you thinking? You want the location but how is skript supposed to know what {_loc} is? You can name a variable however you like and set it to whatever you like so that doesn't make sense. Replace it with "location"
 
What are you thinking? You want the location but how is skript supposed to know what {_loc} is? You can name a variable however you like and set it to whatever you like so that doesn't make sense. Replace it with "location"

Doesn't work. I already tried that and it said loop-block is not a location. I am pretty new to skript, as I joined in March and started in like February.
 
Status
Not open for further replies.