#Block Hardness

1 messages · Page 1 of 1 (latest)

agile slate
#

How would i change the block hardness of yellow stained glass to like a block for example obsidian, so it takes as long to break yellow stained glass the same as obsidian

tacit thistleBOT
#

Obtains the block's hardness level (also known as "strength"). This number is used to calculate the time required to break each block.

Example
set {_hard} to block hardness of target block
if block hardness of target block > 5:
Requirements

Skript 2.6

restive jetty
#

@agile slate

agile slate
restive jetty
agile slate
#

yea what does it do tho,

agile slate
#

in a specific region

restive jetty
#
on load:
  loop all blocks in region "YOUR REGION":
    if loop-block is yellow stained glass:
      set block hardness of loop-block to 1
agile slate
hexed rune
#

Just working on something similar for my server, let me pull up the code I used rq (and yes, you cannot set block hardness)

agile slate
hexed rune
#

ah

hexed rune
#

spacing may or may not be a bit wonky

agile slate
hexed rune
#

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.

agile slate
#

mine is a bit outdated

#

mine is 2.8.2

#

what other skript plugins does it need

hexed rune
#

hm

agile slate
#

like Skellet and allat

hexed rune
#

Oh wait

#

what version is your server?

agile slate
#

1.20.4

hexed rune
hexed rune
#

block_break_speed was introduced in 1.20.5 I think

#

as an attribute

agile slate
#

wow

#

shit

hexed rune
#

lemme check rq

#

yes 1.20.5

agile slate
#

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:

hexed rune
#

basically you want to make the blocks regrow here?

agile slate
#

yea

hexed rune
hexed rune
agile slate
#

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

hexed rune
#

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 :>

agile slate
#

ohh thats a way better way

#

let me figure it out

#

would that work?

hexed rune
#

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?

agile slate
#

hmm

#

imma send you somethign

#

oh right, its so it doesnt drop a normal sugar cane

hexed rune
#

you can use cancel drops

agile slate
#

yea but i have like an /autopickup that messes that up

hexed rune
#

oh

#

alr

agile slate
#

Ive been cooking on this new idea for my server

#

you wanna see?

hexed rune
#

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

agile slate
#

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

hexed rune
#

alrighty

quick sleet
#

it's not a great idea to use ai to write scripts because it has no clue what Skript is. it'll just make up syntax or start doing python or js randomly

#

i would start fresh and ask other people for help with whatever is confusing