#Natural or placed

1 messages · Page 1 of 1 (latest)

slender wharf
#

best you can do, afaik, is set an nbt tag on every block a player places

#

then check for that tag

vivid skiff
#
on place:
  set tag "custom;placedBy" of event-block to uuid of player

function isBlockNatural(l:location) :: boolean:
  return false if nbt compound of block at {_l} has tag "custom;placedBy" else true```
vivid skiff
#

skript + skbee

dense wave
#

ah kk

#

ty

#

ehh could u explain it @vivid skiff

vivid skiff
#

on place it's setting the custom tag placedBy of the block to the uuid of the player that placed it, then you can use the function to know if the block at the location you provided is placed by someone or not

dense wave
#

oh but how can i check whenn the player breaks the block if its a placed one or a natural one

slender wharf
#

use the function

#

although jake i think you meant to flip the true/false

#

and capitalize b

vivid skiff
#

oh right

dense wave
#

it shows me an error

#

lemme write it 1sec

#

Can't understand this condition: nbt compound of block at {_l} has tag "custom;placedBy" else true

#

@vivid skiff

vivid skiff
#

do you have skbee?

dense wave
#

i am pretty sure yes 1sec

#

i do yes

vivid skiff
#

ok 1 second

#
on place:
  set tag "custom;placedBy" of nbt compound of event-block to uuid of player

function isBlockNatural(l:location) :: boolean:
  return false if nbt compound of block at {_l} has tag "custom;placedBy" else true```
#

fixed

#

works for me

dense wave
#

lemme try it 1sec

#

same error hmm

vivid skiff
#

can you show a screenshot of the error?

dense wave
#

sure

vivid skiff
#

uh

#

can you show /sk info?

dense wave
vivid skiff
#

yeah you need 2.3.2

slender wharf
#

yeah your skbee is very behind

dense wave
#

oh

vivid skiff
#

latest is 2.3.3 and that condition was added in 2.3.2