Skript: Right-click event is broken when you specify "with xxx"

Created on 4 Feb 2019  路  8Comments  路  Source: SkriptLang/Skript

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!)
bug completed

All 8 comments

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

@bensku both

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

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

@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

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

@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)

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Coolfire02 picture Coolfire02  路  3Comments

TrademarkTM picture TrademarkTM  路  4Comments

LeotomasMC picture LeotomasMC  路  3Comments

MrScopes picture MrScopes  路  3Comments

TheClassic36 picture TheClassic36  路  3Comments