Skript Crops id (Wheat, Potato, etc etc)

Discussion in 'Skript' started by TeamXd, Jul 31, 2020 at 3:28 PM.

  1. How do I set or replace a block to a full grown crop.

    My current code:

    Code (YAML):
    on block break:
        if event-world is "world2"
    :
            if event-block is in the region "Farm"
    :
                if event-block is fully grown wheat plant
    :
                    if gamemode of player is survival
    :
                       cancel drops
                        set event-block to air
                        give 1 xp to player
                        send action bar "&3+1 EXP" to player
                        play sound "entity.experience_orb.pickup" with volume 0.5 to the player
                        give player 1 wheat
                        wait 5 seconds
                        set event-block to ripe wheat
                        chance of 15%:
                            set event-block to air
                            give player 1 wheat named "&dEnchanted Wheat &8[&e✯&7✯✯&8]" with lore "&f&lUNCOMMON" with hidden enchant
                            message "&7You found &61x &dEnchanted Wheat &8[&e✯&7✯✯&8] &7while harvesting wheat."
                        chance of 10%:
                            set event-block to air
                            give player 2 wheat named "&dEnchanted Wheat &8[&e✯&7✯✯&8]" with lore "&f&lUNCOMMON" with hidden enchant
                            message "&7You found &62x &dEnchanted Wheat &8[&e✯&7✯✯&8] &7while harvesting wheat."
                        chance of 5%:
                            set event-block to air
                            give player 3 wheat named "&dEnchanted Wheat &8[&e✯&7✯✯&8]" with lore "&f&lUNCOMMON" with hidden enchant
                            message "&7You found &63x &dEnchanted Wheat &8[&e✯&7✯✯&8] &7while harvesting wheat."
                        chance of 1%:
                            set event-block to air
                            give player 5 wheat named "&dEnchanted Wheat &8[&e✯&7✯✯&8]" with lore "&f&lUNCOMMON" with hidden enchant
                            message "&7You found &65x &dEnchanted Wheat &8[&e✯&7✯✯&8] &7while harvesting wheat."
                    if gamemode of player is creative
    :
                       stop
                    else
    :
                       cancel event
                        stop