Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Right-click event is broken when you specify "with xxx" #1873

Closed
iOshawott opened this issue Feb 4, 2019 · 8 comments
Closed

Right-click event is broken when you specify "with xxx" #1873

iOshawott opened this issue Feb 4, 2019 · 8 comments
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.

Comments

@iOshawott
Copy link

iOshawott commented Feb 4, 2019

Description

On rightclick event doesn't do what it needs to do when you specify item

Steps to Reproduce

on rightclick with stick:
	if player's tool is stick named "&aPatyk":
		send "hejka" to player
command /patyk:
	trigger:
		add 1 stick named "&aPatyk" to player's inventory
command /sprawdzpatyka:
	trigger:
		if player's tool is stick named "&aPatyk":
			send "hejka" to player

Expected Behavior

on rightclick should send "hejka" to player. It does when you type /sprawdzpatyka, but not on rightclick

It works when you change "on rightclick with stick" to "on rightclick" but on 2.3.2 it was possible to use first version

but anyway it doesn't works with off hand. I don't know how it should work with off hand but it doesn't. (maybe anyone can explain? I see nothing in docs about it but I would love to use it :-:)

Errors / Screenshots

No errors

Server Information

  • Server version/platform: paperclip-513
  • Skript version: 2.3.3 (on 2.3.2 works perfectly!)
@iOshawott iOshawott changed the title On rightclick event on latest is broken On rightclick event on latest is broken when you specify "with xxx" Feb 4, 2019
@bensku
Copy link
Member

bensku commented Feb 4, 2019

Does it not work with stick in main hand, or just with stick in off hand?

@iOshawott
Copy link
Author

@bensku both

@ghost
Copy link

ghost commented Feb 5, 2019

Hey,

something else, which should be fixed with #1808 - but it isn't always.

Skript:
on rightclick: send "Test"

Test

  • Wooden sword in off-tool, tool empty
  • Clicking on an oak wooden door
  • Message does not appear
  • Message appears, when nothing is on off-tool

Skript 2.3.3
newest Paper 1.12.2

@Nicofisi Nicofisi changed the title On rightclick event on latest is broken when you specify "with xxx" Right-click event is broken when you specify "with xxx" Feb 5, 2019
@bensku
Copy link
Member

bensku commented Feb 8, 2019

@iOshawott Cannot reproduce. I suspect this was caused by #1871, since items were named.

@GermanMinerDE Thanks for your report. This was not happening on 1.13, for some reason.

@iOshawott
Copy link
Author

iOshawott commented Feb 8, 2019

@bensku it works on 2.3.4! :) But how to use on rightclick event on off-hand? Still
"if player's tool is ..." doesn't works with off-hand for me ; d
// okay event-item I'll try

@TheBentoBox
Copy link
Member

If you want to check their offhand tool, use if player's offhand tool is...

@iOshawott
Copy link
Author

iOshawott commented Feb 9, 2019

@TheBentoBox

command /karta:
	trigger:
		add 1 paper named "&a&lZdrapka" with lore "&bLuty 2019" to player's inventory
on rightclick with paper:
	if player's offhand tool is paper named "&a&lZdrapka" with lore "&bLuty 2019":
		remove 1 paper named "&a&lZdrapka" with lore "&bLuty 2019" from player's inventory
		set {_v} to 1
		set {_f} to 2 or 1 or 3 or 9 or 7 or 4 or 8 or 5 or 6
	if player's tool is paper named "&a&lZdrapka" with lore "&bLuty 2019":
		remove 1 paper named "&a&lZdrapka" with lore "&bLuty 2019" from player's inventory
		set {_v} to 1
		set {_f} to 2 or 1 or 3 or 9 or 7 or 4 or 8 or 5 or 6
	if {_v} is 1:
		if {_f} is 1:
			add 1 paper of unbreaking 10 named "&b&lKarta Ferie" with lore "&91" to player's inventory
			send "&aZdrapałeś zdrapkę. To karta - &bFerie"

So... Why it doesn't work with off-hand? :v (with normal tool works good)

@bensku
Copy link
Member

bensku commented Feb 22, 2019

It seems that paper counts as usable item. Interesting...

@bensku bensku added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update. labels Feb 22, 2019
bensku added a commit to SkriptLang/skript-aliases that referenced this issue Feb 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. completed The issue has been fully resolved and the change will be in the next Skript update.
Projects
None yet
Development

No branches or pull requests

4 participants