Comments (9)
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.
Someone please verify if this still happens.
from skript.
@bensku I did what he said in the issue and i can confirm. PaperSpigot 1.12.2 and Skript 2.2-dev36.
from skript.
from skript.
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.
What version are you using @antoinech2?
from skript.
Skript 2.2-dev37c with Paper-1438 in Mc 1.12.2
from skript.
Same still happen with firework on 1.12.2
from skript.
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)
- Add version to Skript JARs HOT 3
- Arithmetic returning Object when multiple valid operations causing unexpected parsing
- Error while reloading script with command argument that doesn't exists HOT 6
- Update Paper API to 1.20.6 HOT 1
- Prefixes HOT 7
- large_smoke particle generates error on Paper/Spigot 1.20.6 HOT 13
- NoClassDefFound Error HOT 3
- Legacy Code Tracker
- unexpected repair/damage behaviour HOT 4
- Add recently added attributes HOT 2
- Searching Feature
- Add experience class into accept change on ExprTotalExperience
- Add skript-reflect (or at least some features) into Skript HOT 1
- Expose required variable changes for save as a config option
- SimpleLiterals pass "constant" backing array to other syntax.
- Stop referencing the old Converter class in PropertyExpression HOT 2
- Wither HOT 2
- Allow `armour stand` as `armor stand` HOT 2
- Entities despawning when target is set HOT 1
- bStats syntax for Skript HOT 14
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from skript.