Right clicking to break block - Jobs/Mcmmo support

  • 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 community!

    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.

Dart737

Member
Nov 4, 2017
3
0
0
Hello everyone,
I'm attempting to make my first skript but I've come across a problem that I need a bit of help on because I can't seem to fix it.
My plugin: I'm attempting to make a plugin where all crops could be right clicked to harvest and they will automatically replant themselves, I'm nearly finished with it and it is actually fully working in principle. Basically, its doing what it needs to, however, because the block isn't directly broken by the player, its not giving the player mcMMO skill or Jobs Reborn money. I've attempted to fix this by using Skillett's "Naturally break block" option as well as the normal "Break block" methord but its had no effect either way.
Here's the skript (Just the part on wheat so I don't post a sort of repeating of the same thing over and over.:

code_language.skript:
on rightclick on soil:
    block above is air
    player has seeds
    
    set block above to crops
    remove seeds from player

on rightclick on ripe wheat:
    naturally break block
    set block to crops
First part I also need help on because planting also gives Mcmmo exp.
Now, I know many of you will ask: Why not change the "on right click on ripe wheat" to "On break on ripe wheat", I want to prevent right clicking if I can because I feel like it defeats the point. The point of right clicking to harvest is because you can do it so much faster. If it can't be done without manually breaking, I guess I'll do it, but I feel like it can be and I just don't know how.
Thanks for any help or tips that can be provided.
[doublepost=1509980927,1509812143][/doublepost]Bump
Sorry if bumping isn't allowed on this forum, I looked but couldn't find rules section anywhere.
Also, I'm aware that I could have it run a command to give exp to the player everytime, but this would happen so frequently I'm afraid it would lag the server or spam the console. Also, it would make configuring mcmmo/jobs a bit more difficult cause any exp changes/money changes I make, I'd also have to change in the skript as well.
 
Ahh, ok then, could you show me?
code_language.skript:
#auto-plant
on rightclick on ripe_crops or potato_plant or carrot_plant or beetroot_block or nether_wart_block:
    if player is sneaking:
        if data value of block = 3:
            if type of block = beetroot_block:
                drop ((random integer between 0 and 3) - 1) of beetroot_seeds
                set block to beetroot_block
            else if type of block = nether_wart_block:
                drop ((random number between 2 and 4) - 1) of nether_wart_item
                set block to nether_wart_block
        else if data value of block = 7:
            if type of block = ripe_wheat:
                drop (random integer between 1 and 2) of wheat
                drop ((random integer between 0 and 3) - 1) of wheat_seeds
                set block to freshly_planted_wheat
            else if type of block = potato_plant:
                drop ((random integer between 1 and 4) - 1) of potato
                set block to potato_plant
                chance of 2%:
                    drop poisonous_potato
            else if type of block = carrot_plant:
                drop ((random integer between 1 and 4) - 1) of carrot_item
                set block to carrot_plant
 
code_language.skript:
#auto-plant
on rightclick on ripe_crops or potato_plant or carrot_plant or beetroot_block or nether_wart_block:
    if player is sneaking:
        if data value of block = 3:
            if type of block = beetroot_block:
                drop ((random integer between 0 and 3) - 1) of beetroot_seeds
                set block to beetroot_block
            else if type of block = nether_wart_block:
                drop ((random number between 2 and 4) - 1) of nether_wart_item
                set block to nether_wart_block
        else if data value of block = 7:
            if type of block = ripe_wheat:
                drop (random integer between 1 and 2) of wheat
                drop ((random integer between 0 and 3) - 1) of wheat_seeds
                set block to freshly_planted_wheat
            else if type of block = potato_plant:
                drop ((random integer between 1 and 4) - 1) of potato
                set block to potato_plant
                chance of 2%:
                    drop poisonous_potato
            else if type of block = carrot_plant:
                drop ((random integer between 1 and 4) - 1) of carrot_item
                set block to carrot_plant
I mean...thats great and all but its no different from what I've created. The problem isn't me getting the skript working,as I said in the original post, the problem is its not working with mcmmo and jobs. The skript you've sent me does the exact same thing and doesn't work with jobs/mcmmo. It also doesn't drop beetroot, just seeds. And it requires crouching.
[doublepost=1511022444,1511020001][/doublepost]I think I'm just gonna admit defeat, I've had this post up here for nearly 2 weeks and the only answer I've gotten is something that doesn't work, so I'm gonna just give up, I'm just gonna change it to replant things when they're broken
 
Status
Not open for further replies.