AimPy

make me a client side farming skript for any type of block, for example coal ore, crops that are fully grown, oak logs and etc. Make it simple, just start with the base purpose of making it client sided. Which means that per player, they can see the block, but when broken, other players can still see it. I believe you need to utilize skbee and skpoa for this. Also, I dont need you to set the drops, the xp received, as I will handle this on my own plugins alongside. I just need the base code to set the delay on how fast it regenerates. For blocks, when breaking it, it should turn into bedrock, for crops or other related farming blocks, it should become a seed.

Kodari AI
KodariMay 28 at 5:51 am 3
ClientSideFarming
A client-side farming system that makes blocks appear broken only to the harvesting player, while remaining visible to others. Supports any block type including ores, logs, and fully-grown crops. Broken blocks visually replace with bedrock (or seeds for crop-type blocks) for the harvesting player only, then regenerate after a configurable delay. Built using SkBee and SkPoa for per-player block visuals.

A few notes before the code:

  • SkBee handles the fake block visuals per-player (player's fake block at location)

  • SkPoa (Skript Port of Addons) is needed for per-player block break packet cancellation

  • The script cancels the real block break, then sends fake block states to only the breaking player

  • Crop detection checks if the block is a crop-type and uses the seed equivalent as the “broken” visual


Setup:

  1. Drop ClientSideFarming.sk into plugins/Skript/scripts/

  2. Run /sk reload ClientSideFarming

How it works:

Scenario
What the breaking player sees
What others see
Breaks an ore/log/etc
Bedrock
Original block (untouched)
Breaks a fully-grown crop
Air
Original crop (untouched)
After regen delay
Original block restored
No change

Config options (top of file):

  • default-regen-delay — seconds until non-crop blocks visually restore (default: 30)

  • crop-regen-delay — seconds until crop blocks visually restore (default: 20)

What’s intentionally excluded (as requested): drops, XP, and any economy hooks — handle those in your own plugin via a BlockBreakEvent listener since the real block is never actually broken.

AimPy

also I only want this in a specific world, can you also add that

Kodari AI
KodariMay 28 at 5:54 am 2

One change: added {@farming-world} option at the top — set it to your world’s exact name (e.g. world, survival, mining, etc.). The break event hard-stops if the player isn’t in that world, so no other worlds are affected.

AimPy

error on line 51, and line 63

Kodari AI
KodariMay 28 at 6:05 am 3

Let me see the file first.

Lines 50 and 62 use SkBee’s fake block syntax — the issue is likely that SkBee uses a different expression form. The correct syntax is set fake block at {_loc} for {_player} and reset fake block at {_loc} for {_player}.

All three fake block calls updated to SkBee’s correct syntax:

  • set fake block at {_loc} for {_player} to {_fake} — shows the fake state

  • reset fake block at {_loc} for {_player} — restores the real block visually

  • Same reset applied in the quit cleanup handler

Run /sk reload ClientSideFarming and the errors should be gone.

AimPy

now it throws an error on line 51, 57, 62, 69, and 71

Kodari AI
KodariMay 28 at 6:08 am 3

Let me read the current file to see exact content at those lines.

The issue is SkBee’s fake block syntax. The correct SkBee expression is set {_player}'s fake block at {_loc} to {_fake} and reset {_player}'s fake block at {_loc}. Also wait inside on break needs an async wrapper, and the quit loop needs fixing.

All fake block calls switched to SkBee’s possessive syntax:

  • set {_player}'s fake block at {_loc} to {_fake}

  • reset {_player}'s fake block at {_loc}

  • reset player's fake block at {_loc} (quit handler)

/sk reload ClientSideFarming and those lines should clear up.

AimPy

how can I use this

make player see block at event-block as event-block

to make the player see the block at event block as wheat age 1

Kodari AI
KodariMay 28 at 7:13 am 5

That expression is from SkBee. The syntax would be:

Plain Text
make player see block at event-block as wheat[age=1]

SkBee uses blockdata notation with [property=value] for block states. For wheat specifically, age=7 is fully grown, so the stages are:

Expression
Result
wheat[age=0]
Just planted (tiny sprout)
wheat[age=3]
Half grown
wheat[age=7]
Fully grown
wheat[age=1]
Stage 1 (what you asked)

So in context inside an event:

Plain Text
on break:
    make player see block at event-block as wheat[age=1]

You can use this same pattern for any block with states — for example:

Plain Text
make player see block at event-block as oak_log[axis=y]
make player see block at event-block as chest[facing=north]
make player see block at event-block as stone

For blocks with no states (like stone), just use the plain block name with no brackets.

Kodari can make mistakes. Review important code before using.
Files
ClientSideFarming.sk
Code
1 71
ClientSideFarming.sk
# ============================================================
# ClientSideFarming.sk
# Client-side block farming — fake breaks per player only
# Requires: SkBee, SkPoa
# ============================================================

options:
    # World where client-side farming is active
    farming-world: world

    # Delay in seconds before the block visually restores
    default-regen-delay: 30
    crop-regen-delay: 20

    prefix: &8[&aFarming&8]&r

# ---- Crop type check function ----
# Returns true if the block is a crop-type (should show air on break)
function isCropBlock(b: block) :: boolean:
    set {_type} to type of {_b}
    if {_type} is wheat, carrots, potatoes, beetroots, nether wart, cocoa, sweet berry bush, cave vines, cave vines plant, pitcher crop, torchflower crop:
        return true
    return false

# ---- On block break ----
on break:
    # Only active in the configured world
    if world of event-block is not world({@farming-world}):
        stop

    # Only players
    if event is not cancelled:
        set {_loc} to location of event-block
        set {_block} to event-block
        set {_type} to type of event-block
        set {_player} to player

        # Cancel the real break — block stays for everyone else
        cancel event

        # Determine what fake block to show the breaking player
        if isCropBlock(event-block) is true:
            set {_fake} to air
            set {_delay} to {@crop-regen-delay}
        else:
            set {_fake} to bedrock
            set {_delay} to {@default-regen-delay}

        # Show the fake broken state only to this player
        set {_player}'s fake block at {_loc} to {_fake}

        # Mark this location as "broken" for this player
        set {clientfarm::%{_player}%::%{_loc}%} to {_type}

        # Schedule regen for this player at this location
        wait {_delay} seconds

        # Only restore if still marked (not already restored)
        if {clientfarm::%{_player}%::%{_loc}%} is set:
            # Remove the fake block — player sees the real block again
            reset {_player}'s fake block at {_loc}
            delete {clientfarm::%{_player}%::%{_loc}%}

# ---- Cleanup on player quit ----
on quit:
    # Clear all fake block entries for this player
    loop indices of {clientfarm::%player%::*}:
        set {_loc} to loop-value parsed as location
        if {_loc} is set:
            reset player's fake block at {_loc}
    delete {clientfarm::%player%::*}