Broken Blocks no Velocity + stacking

  • 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.

DJ411

Member
Mar 24, 2018
2
0
0
34
I've been trying to work on a small task skript where when i mine a block instead of bouncing all over the place it would go to the player. Almost teleport to the player. Also with stacking. Like if there is already 1 block it would just be 2 almost like those mob stacking plugins but for an item.

Just wondering if this is possible as i can't seem to get past the item teleportation correctly.
 
You could do something simple like
code_language.skript:
On block break:
    cancel event
    set event-block to air
    give player 1 of event-block
 
You could do something simple like
code_language.skript:
On block break:
    cancel event
    set event-block to air
    give player 1 of event-block

Thanks for the reply. I had similar results but with worse code lol. But the same outcome is happening. Its giving free silk touch with out having it. But i also test this with a full inventory. I can't give them something when its full. Why i have the item drop at their location or a clear spot nearby.
i guess it can't be done easily without checks and stuff.
 
Thanks for the reply. I had similar results but with worse code lol. But the same outcome is happening. Its giving free silk touch with out having it. But i also test this with a full inventory. I can't give them something when its full. Why i have the item drop at their location or a clear spot nearby.
i guess it can't be done easily without checks and stuff.

Oh right i forgot it'll just give them the ore block

You could try something like this
code_language.skript:
on block break:
    cancel event
    set event-block to air
    loop players inventory:
        if loop-block is air:
            if event-block is diamond ore:
                give player 1 of diamond
                stop
        else:
            send "Your inventory is too full" to player

Its not the cleanest code, but it gives you an idea of how it could work
 
code_language.skript:
on break:
  wait 1 tick
  event.isCancelled() is false
  delete dropped items in radius 0.25 of event-block
  give player (event-block.getDrops(((tool of player).getRandom()))
something like this would do the job
 
code_language.skript:
on break:
  wait 1 tick
  event.isCancelled() is false
  delete dropped items in radius 0.25 of event-block
  give player (event-block.getDrops(((tool of player).getRandom()))
something like this would do the job
Well that looks much cleaner than mine... are you using Skript-Mirror for that?
 
Status
Not open for further replies.