Skript

Skript

743k Downloads

Right Click event w/ shield broken

Sleaks123 opened this issue ยท 1 comments

commented

Skript/Server Version

Server Version: 1.21 
Skript Version: Skript Nightly Build
No skript addons
no dependencies

Bug Description

    if player's tool is a shield:
        cancel event
        send action bar "&cYou cannot use your shield while in combat!" to player
    if player's offhand item is a shield:
        cancel event
        send action bar "&cYou cannot use your shield while in combat!" to player

In this code, the shield event is getting cancelled only when looking at the air. It doesn't work when aiming at a player or at a block.

Expected Behavior

Should be disabled no matter where you aim.

Steps to Reproduce

on right click:
if player's tool is a shield:
cancel event
send action bar "&cYou cannot use your shield while in combat!" to player
if player's offhand item is a shield:
cancel event
send action bar "&cYou cannot use your shield while in combat!" to player

Errors or Screenshots

No response

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this report.
commented

Tested on 1.20.4 Paper, Skript 2.9.0. Right-clicking a player/npc does not cancel the event, although right-clicking a block does work.