Skript and all addons: Skript v2.2-dev23. SkQuery v3.21.4, skRayFall v1.9.7, TuSKe v1.6.7, SharpSK v1.6.0, RandomSK v2.7.1, SkStuff v1.6.2.
MC Version: 1.8.8.
Note: The sendOwner function is irrelevant. It works fine. It is simply helpful to debug stuff, which is why I have used it to try to debug this script.
Errors on reload: None
Console Errors: None
Troubleshooting:
Have tried the docs.
Have searched the forums. Perhaps I am using the wrong search words?
I have also tried using "on leftclick on any block:" or "on leftclick on a block:" to replace the leftclick event.
Full Description of Error:
If I leftclick (holding soup) normally, looking at the air, everything works fine. Similarly, if I rightclick (holding soup) normally while looking at a block within range, everything still works fine. Soup works in those cases.
However, when I right click (holding soup) in the air, the soup applies regeneration, healing, sends the sendOwner notification, and plays the sound, though it does not remove the soup.
Also, when I left click (holding soup) on a block within range, nothing happens. The event does not fire, I believe.
Note: I tested this in adventure mode. I will need the script to work while players are in adventure mode.
When clicking with soup:
[doublepost=1500303385,1500219677][/doublepost]UPDATE
Creating a new issue at github.com/bensku/Skript/etc.
SOLUTION
Rightclicking bug – I have simply removed rightclicking from the script. Soups are left-click only.
Leftclick bug fix:
1. I have set the players to survival and disabled block-editing.
2. I am using 2 events – on leftclick and on block damage.
on block damage fills the void that on leftclick leaves when players leftclick a block.
MC Version: 1.8.8.
code_language.skript:
on leftclick holding mushroom stew:
if player has permission "arim.soup":
set {_prot} to spawnProt(player)
if {_prot} is false:
sendOwner("&5%name of player% &3–– &anormal soup leftclick.")
soup(player)
else:
set player's action bar to "&cSoups disabled in this world"
on rightclick holding mushroom stew:
if player has permission "arim.soup":
set {_prot} to spawnProt(player)
if {_prot} is false:
sendOwner("&5%name of player% &3–– &anormal soup rightclick.")
soup(player)
else:
set player's action bar to "&cSoups disabled in this world"
function soup(p: player):
clear tool of {_p}
heal {_p} by 1 hearts
remove regeneration from {_p}
apply potion of regeneration of tier 3 to {_p} for 3 seconds
play orb pickup at {_p} with pitch 1
Errors on reload: None
Console Errors: None
Troubleshooting:
Have tried the docs.
Have searched the forums. Perhaps I am using the wrong search words?
I have also tried using "on leftclick on any block:" or "on leftclick on a block:" to replace the leftclick event.
Full Description of Error:
If I leftclick (holding soup) normally, looking at the air, everything works fine. Similarly, if I rightclick (holding soup) normally while looking at a block within range, everything still works fine. Soup works in those cases.
However, when I right click (holding soup) in the air, the soup applies regeneration, healing, sends the sendOwner notification, and plays the sound, though it does not remove the soup.
Also, when I left click (holding soup) on a block within range, nothing happens. The event does not fire, I believe.
Note: I tested this in adventure mode. I will need the script to work while players are in adventure mode.
code_language.skript:
#Entire function works when left clicking in the air OR righ tclicking a block
function soup(p: player): #Entire function does not work when left clicking a block
clear tool of {_p} #Does not work while right click the air
heal {_p} by 1 hearts
remove regeneration from {_p}
apply potion of regeneration of tier 3 to {_p} for 3 seconds
play orb pickup at {_p} with pitch 1
When clicking with soup:
- Normal leftclick in air: Works fine.
- Normal rightclick in air: Soup is not removed ('clear tool of {_p}' does not work)
- Normal leftclick on block: Nothing happens. Event is not fired.
- Normal rightclick on block: Works fine.
[doublepost=1500303385,1500219677][/doublepost]UPDATE
Creating a new issue at github.com/bensku/Skript/etc.
SOLUTION
Rightclicking bug – I have simply removed rightclicking from the script. Soups are left-click only.
Leftclick bug fix:
1. I have set the players to survival and disabled block-editing.
2. I am using 2 events – on leftclick and on block damage.
on block damage fills the void that on leftclick leaves when players leftclick a block.
Last edited: