Crop Harvester

  • 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 our Wiki for downloads and any other information about Skript!

Status
Not open for further replies.

SH4D03

Member
Jan 13, 2020
1
0
0
Skript Verson: skript 2.4
Skript author: Bensku
Minecraft Version; 1.14.4

Hi. I hope its not too much to ask but I've been trying to create a crop harvestor skript. This is an item that when placed auto farms nearby crops and deposits the items in a chest. The code that I have created looks fine to me and when I run it it doesn't show any errors but for some reason it doesn't work. Here's the code:

Code:
every 10 seconds in "world":
   loop all blocks in {cropharvestor::*}:
      if block at location of loop-block-1 is a dropper named "&2&lCrop Harvestor":
#Wheat
         loop all blocks in radius 5 around the loop-block-1:
            loop-block-2 is fully grown wheat plant
            set loop-block-2 to wheat plant
            loop all blocks in radius 4 around the loop-block-1:
               loop-block-3 is a chest
               add 2 wheat to loop-block-3's inventory
               exit loop
#Carrots
         loop all blocks in radius 5 around the loop-block-1:
            loop-block-2 is fully grown carrot plant
            set loop-block-2 to carrot plant
            loop all blocks in radius 4 around the loop-block-1:
               loop-block-3 is a chest
               add 2 carrot to loop-block-3's inventory
               exit loop
#Potatoes
         loop all blocks in radius 5 around the loop-block-1:
            loop-block-2 is fully grown potato plant
            set loop-block-2 to potato plant
            loop all blocks in radius 4 around the loop-block-1:
               loop-block-3 is a chest
               add 2 potato  to loop-block-3's inventory
               exit loop
#Nether Wart
         loop all blocks in radius 5 around the loop-block-1:
            loop-block-2 is fully grown nether wart plant
            set loop-block-2 to nether wart plant
            loop all blocks in radius 4 around the loop-block-1:
               loop-block-3 is a chest
               add 2 nether wart to loop-block-3's inventory
               exit loop
 


command /cropharvestor:
   permission: op
   permission message: You are unable to perform this action
   trigger:
      give dropper named "&2&lCrop Harvestor" to player

on place of dropper:
   if player's tool is a dropper named "&2&lCrop Harvestor":
      set block to dropper named "&2&lCrop Harvestor"
      add location of block to {cropharvestor::*}

If someone could help me with this I'd be really grateful.
 
Status
Not open for further replies.