Solved Block Breaking

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

MusicManSK

Active Member
Nov 30, 2017
230
11
18
Hello!
Can anyone help me?
Probably not because 1. I have questions with impossible answers or 2. As ususal, unluck...
But Im trying luck...
So..
How to break block without dropping any items?
  • I dont want to loop nearby entities, because i can see that dropped item before it will get killed..
  • I dont want to cancel event and set event-block to air, because I can see that block getting back and i cant mine fo fast and smoothly..
  • I dont want to setup gamerules, because in other world I want blocks drops items.. only if it would be for one certain world, not for the entire server..
Is it possible?
 
The closest I could find is "On item spawn." It is called when ANY item is dropped. So you could just cancel all items.

I couldn't find an actual way of obtaining the reason for spawn.... I was trying to look through the docs to find a way to check the reason.
 
i know this is not exactly what you want, but i feel like you are running low on options.
Anyways, i gave myself a diamond shovel with efficiency 5, ran this code, and the grass still breaks super duper fast, and no drops

code_language.skript:
on block break:
    if event-block is grass:
        cancel event
        set event-block to air

im not really sure why you said:

"I dont want to cancel event and set event-block to air, because I can see that block getting back and i cant mine fo fast and smoothly.."

because when i try it, the blocks still break fast, and they are breaking fast enough i do not really notice the "cancel event"
 
Its OK.. I already made it..
Because Im working on prison.. and i have shovel with efficiency 40 and there is visible difference between canceling event and not canceling.. also its visible because You break block > Skript will cancel event and set it back into broken block > You set that block to air.. and there is visible that getting this block back.. and thats reason why its slower.. but i already done it so it ok.. thanks for replyng
 
  • Like
Reactions: ShaneBee
Its OK.. I already made it..
Because Im working on prison.. and i have shovel with efficiency 40 and there is visible difference between canceling event and not canceling.. also its visible because You break block > Skript will cancel event and set it back into broken block > You set that block to air.. and there is visible that getting this block back.. and thats reason why its slower.. but i already done it so it ok.. thanks for replyng
Mmm, i'm using an autoinv feature in my prison server (made it with skript and set event-block to air) and everything works perfect, no lag and no "cooldown" when a player breaks a Block
 
Status
Not open for further replies.