#Block Hardness
1 messages · Page 1 of 1 (latest)
Obtains the block's hardness level (also known as "strength"). This number is used to calculate the time required to break each block.
set {_hard} to block hardness of target block
if block hardness of target block > 5:
Skript 2.6
@agile slate
What does the if block harndess of target block > 5: do?
its a condition
yea what does it do tho,
How would i make the yellow stained glass that block harndess tho?
in a specific region
try
on load:
loop all blocks in region "YOUR REGION":
if loop-block is yellow stained glass:
set block hardness of loop-block to 1
it shows this error
Just working on something similar for my server, let me pull up the code I used rq (and yes, you cannot set block hardness)
I was trying to make like the skyblock crystals if you know what im talking about, they take a while to break
ah
on block damage:
if event-block is red glass:
set player's block break speed attribute to 0.4
else:
set player's block break speed attribute to 1
spacing may or may not be a bit wonky
what skript version is this? because mine shows these errors
My server is 1.21.4 with Skript version 2.10.2. If your Skript version is above 2.6.1 it should work fine.
hm
like Skellet and allat
1.20.4
it's just vanilla Skript
There's the problem then
block_break_speed was introduced in 1.20.5 I think
as an attribute
hmm, less of my plugins would go bad if i only upgrade 1 version right
instead of 1.21.4
Hey also i got another question for you, would there be a better way to make this:
basically you want to make the blocks regrow here?
yea
probably true, updating from 1.20.5 to 1.20.6 would be bad, but updating from 1.20.4 to 1.20.5 probably won't cause any issues. You might have to fix some scripts, but I'm not sure since I've never updated the version of a server with Skript.
do you want me to write it or help you write it?
Im not really that familiar with skript but you could try and help me, ive only really gotten examples from ChatG ::P::T
it wont let me type the actual thing
tbh I started with ChatG .P .T for little things and just looked at the code and tried to figure it out :)
Alr so right now you are doing a loop every 5 seconds to check if some blocks are set to sugar cane. In Skript, the more loops you use, the better the performance of the script will be (small loops are okay, but looping all players every tick or many blocks every second can cause server lag). Instead of a loop, it is more efficient to check for when the block actually breaks, so that it can respawn 5 seconds later.
Here are the lines I would use for this:
wait 5 seconds
on break of sugarcane:
set event-block to sugar cane
if event-block is in region "dusk":
I'll leave it to you to put it together as a little puzzle :>
remove the : after the drop 1 of {SavedItems::dsugar} event-location, you don't need it there and Skript will give you an error. Everything after that can be on the same indentation as the drop 1 of {SavedItems::dsugar} event-location. Also is there a reason why you are setting the block to air after it breaks?
you can use cancel drops
yea but i have like an /autopickup that messes that up
can't join as of rn, if you send me the IP I can join in a couple of hours if you're fine with that
Ill be at work by then but its fine
anyways i really appreciate the help and i will be upgrading the server when i shut down for new season
alrighty