GithubHelp home page GithubHelp logo

more hand/off-hand issues about skript HOT 9 CLOSED

Pilvinen avatar Pilvinen commented on May 25, 2024
more hand/off-hand issues

from skript.

Comments (9)

TheBentoBox avatar TheBentoBox commented on May 25, 2024

I verify this old issue, it is still occurring in 2.2-dev22g.

The problem of course lies in EvtClick.java, but this is a very complicated issue. In this particular situation, there's actually NO right click event being fired by Skript. I tried with this code:

on right click:
	send "%event-item%"

Then put a piece of dirt in my main hand, an iron hoe in my offhand, stood on top of some dirt and looked down, then tried to hoe it -- no message.

For @bensku, something that could help you out is checking out the method summary of the PlayerInteractEvent in detail, most particularly the hasBlock and hasItem functions, especially combining the former with the isBlockInHand function. Really, the issue is Spigot's poor implementation of the dual wielding feature. Realistically, it should just fire one click event -- the one that actually went through. It's such a pain to actually determine which hand's event actually happened as there are so many particular edge cases. For example, if you're standing BARELY inside of a block, and are holding a piece of dirt in your main hand and a small block (e.g. flower pot) in your offhand, the flower pot placement will go through, but any reasonable method of checking would probably tell you that nothing happened as the player tried to place something where they couldn't (since both hands held a block and they were trying to place it inside of themselves).

Not sure of the best way to progress, I'll poke around for any good API-side solutions.

from skript.

bensku avatar bensku commented on May 25, 2024

Someone please verify if this still happens.

from skript.

Blueyescat avatar Blueyescat commented on May 25, 2024

@bensku I did what he said in the issue and i can confirm. PaperSpigot 1.12.2 and Skript 2.2-dev36.

from skript.

TheLimeGlass avatar TheLimeGlass commented on May 25, 2024

https://github.com/SkriptLang/Skript/blob/master/src/main/java/ch/njol/skript/bukkitutil/Workarounds.java

from skript.

antoinech2 avatar antoinech2 commented on May 25, 2024

Hi, I have the same problem with shulker boxes:

on right click: if clicked block is a shulker box: send "Shulker box clicked!"

If you have any item in your off-hand, and no item in your main hand, the event is not called.
Only for shulker box.
Is there an alternative to do this with skript?

from skript.

TheBentoBox avatar TheBentoBox commented on May 25, 2024

What version are you using @antoinech2?

from skript.

antoinech2 avatar antoinech2 commented on May 25, 2024

Skript 2.2-dev37c with Paper-1438 in Mc 1.12.2

from skript.

Malachiel87 avatar Malachiel87 commented on May 25, 2024

Same still happen with firework on 1.12.2

from skript.

FranKusmiruk avatar FranKusmiruk commented on May 25, 2024

Closing this since most of the things mentioned above were fixed and even then, there are new issues covering it.

from skript.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.