Solved Event Triggers When it Shouldn't

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

Rebel100

Member
Sep 17, 2020
12
0
1
24
AIght I have been stuck on this issue for a couple of hours and have tried a million things I am trying to create a bedrock pillar only when I right click a villager with a stick however this doesn't work as it ignores the with a stick and does it no matter what.

Code:

on right click with a stick on a villager:
send "test" to all players
set {_loc1} to location of villager
set {_loc2} to block 75 above block at location of villager
loop all blocks between {_loc1} and {_loc2}:
set loop-blocks to bedrock

The weird thing is it when I right click a villager without a stick it does NOT send the "test" message but still creates the bedrock pillar. However, when I right click a villager with a stick it sends the message and creates the Bedrock pillar. This really confuses me as how is it getting triggered when I am not holding a stick clearly it knows this because it only sends the message when I am holding a stick. If any body could help me that would be great I am completely stumped!

Skript Version: 2.5.3
Errors: None it compiles without errors

I am running Skript using a server which is running Spigot 1.16.4 if it helps.

plz help
 
I think instead of doing "on right click with a stick on villager" you should do "on right click on a villager: if player's held item is a stick:"
 
I think instead of doing "on right click with a stick on villager" you should do "on right click on a villager: if player's held item is a stick:"

Thanks for trying to help but I just tested that again and is still does not work it will only send "test" if I am holding a stick but it will still build the tower no matter what.
[doublepost=1608830958,1608828768][/doublepost]I realized the problem on my own I had a separate program running that would add the pillar every right click!
 
I tried this and it works
Code:
on right click with stick:
    if clicked entity is a villager:
        send "test" to all players
        set {_loc1} to location of villager
        set {_loc2} to block 75 above block at location of villager
        loop all blocks between {_loc1} and {_loc2}:
            set loop-blocks to bedrock
 
I tried this and it works
Code:
on right click with stick:
    if clicked entity is a villager:
        send "test" to all players
        set {_loc1} to location of villager
        set {_loc2} to block 75 above block at location of villager
        loop all blocks between {_loc1} and {_loc2}:
            set loop-blocks to bedrock
Ya I was being dumb and has a separate Skript running that would do it all the time!
 
Status
Not open for further replies.