Script Version: 2.6.3
Script Author: Me (RazorBl8de)
Minecraft Version: 1.18.2
Hi I have been trying to make a right-click detection for making a closet that you can hide in.
I know that this code doesn't work, but it tells you want I want done.
Basically, if a player right clicks an acacia door, they get teleported to the nearest invisable armorstand with the tag 'closet' , the player gets invisability, and a tag is applied so that the player can leave the closet when the player shifts.
on right click:
if clicked block is "<acacia_door>":
execute console command "/teleport <player> @e[sort=nearest,tag=closet]"
execute console command "/effect give <player> invisibility 1000000 1 true"
execute console command "/tag <player> add inCloset"
if player tag is inCloset:
if player crouches:
execute console command "/teleport <player> @e[sort=nearest,tag=closet] ^ ^ ^1"
execute console command "/effect clear <player> invisibility"
execute console command "/tag <player> remove inCloset"
I am new to Skript and I don't know much. could you please fix this code and tell me how you fixed it please.
Thank you.
[doublepost=1668581908,1668581819][/doublepost]And yes, it is indented correctly.
Here is the code in it's correct format: https://pastebin.com/s0hFCntN
Script Author: Me (RazorBl8de)
Minecraft Version: 1.18.2
Hi I have been trying to make a right-click detection for making a closet that you can hide in.
I know that this code doesn't work, but it tells you want I want done.
Basically, if a player right clicks an acacia door, they get teleported to the nearest invisable armorstand with the tag 'closet' , the player gets invisability, and a tag is applied so that the player can leave the closet when the player shifts.
on right click:
if clicked block is "<acacia_door>":
execute console command "/teleport <player> @e[sort=nearest,tag=closet]"
execute console command "/effect give <player> invisibility 1000000 1 true"
execute console command "/tag <player> add inCloset"
if player tag is inCloset:
if player crouches:
execute console command "/teleport <player> @e[sort=nearest,tag=closet] ^ ^ ^1"
execute console command "/effect clear <player> invisibility"
execute console command "/tag <player> remove inCloset"
I am new to Skript and I don't know much. could you please fix this code and tell me how you fixed it please.
Thank you.
[doublepost=1668581908,1668581819][/doublepost]And yes, it is indented correctly.
Here is the code in it's correct format: https://pastebin.com/s0hFCntN