Cancel block placing if its on tall grass

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

lukep999

Member
Jul 30, 2017
3
0
0
Hi,

My idea is that when a player places a block, it checks whether the space they're placing the block is air or not. For example, if there is tall grass on the ground and a player places a block there, it will remove the tall grass and replace it with the block. I would like it so players are not able to place blocks on tall grass. My addons are SkQuery, SkRayfall, Skellett and Umbaka.

Thank you.
 
uh, not sure if this what you mean but

code_language.skript:
on place:
     if block at event-location is tall_grass:
          cancel event
 
uh, not sure if this what you mean but

code_language.skript:
on place:
     if block at event-location is tall_grass:
          cancel event
I thought this would work however it stops me from placing tall grass blocks not stopping building over tall grass blocks.
A better example is placing blocks in water, I don't want players to be able to place any blocks in water e.g to break a source block.

Thanks for your help though :emoji_slight_smile:
 
I thought this would work however it stops me from placing tall grass blocks not stopping building over tall grass blocks.
A better example is placing blocks in water, I don't want players to be able to place any blocks in water e.g to break a source block.

Thanks for your help though :emoji_slight_smile:
I've not tested it, so I'm not 100% sure, but I think this might work! Cheers.
code_language.skript:
on place:
    target block is tall_grass:
        cancel the event
 
Status
Not open for further replies.