#Simultaneous Right and Left Click not functioning

1 messages · Page 1 of 1 (latest)

night fable
#

I have created the left and right-click detection files yet the functions for the attack button on my mouse doesn't seem to let the use button on my mouse to run its suggested function.

graceful gulch
#

What are you using for left click detection?

night fable
#

enchantments.

#

ummm... did i get that wrong?

graceful gulch
#

Enchantments certainly is a thing

night fable
#

it's just that the left-click makes it so that right-clicking doesn't work.

graceful gulch
#

Yep, but it's helpful to know what methods you're using, and left click detection has a wider, newer range

night fable
#

Oh?

#

How would you put it? Maybe I'm using a more, obsolete version, then.

graceful gulch
#

If you're using enchantments then no, you're not

#

I don't know why you think "enchantments" isn't an acceptable answer

night fable
#

I just searched it up... (I wasn't even sure if I got it correct)

graceful gulch
#

How about you actually explain how you are doing left click detection then

#

Because I cannot read your mind

night fable
#

Ok, so the item has an enchantment. This enchant has the post_piercing_attack effect attached to it. It should run a function. But it doesn't work with right-clicking.

graceful gulch
#

That is in fact using an enchantment, and it is new, not that that matters

#

So yes, it's checking if you're doing a jab attack, during which you can't use (aka right click) other items, and vice versa

#

This is expected behavior

night fable
#

I did use consumable components too for right clicks.

graceful gulch
#

Yep, which means those work by attempting to use the item, literally attempting to eat it

#

You can't eat food while attacking with a spear, same concept applies here

night fable
#

so it's impossible.

graceful gulch
#

There is probably not a clean way to check if the player is both left and right clicking in the same tick, no

night fable
#

What do you suggest then?

graceful gulch
#

For what?

#

I don't know what mechanic you're trying to implement, all I can infer is you want to detect if the player left clicks and right clicks at the same time. We've established you can't do that, so I don't know what you're asking

night fable
#

So I want an item that runs an ability either one left or right click.

#

more like a function?

graceful gulch
#

If you want it on either left or right click, why is it a problem that it can't detect both at the same time?

graceful gulch
night fable
#

yeah.

#

For some reason the left-click overrides the right-click.

graceful gulch
#

Why does that matter? If the left click detection is working, then the ability should run fine, yes?

lyric quartz
#

what do you mean exactly by that? more to the point: you said how you set up your left click detection, but how have you set up your right click detection?

lyric quartz
#

yes, but detection

night fable
#

i used advancements.

lyric quartz
#

just double checking. so then again, you mean your advancement isnt working on your item with the left click detection?

night fable
#

pretty much.

lyric quartz
#

hm, my immediate guess would be something off in your advancement then. could you send that in ``` code blocks, along with whatever gives your item

night fable
#

I used recipes...

#
    "criteria": {
        "using_item": {
            "trigger": "minecraft:using_item",
            "conditions": {
                "item": {
                    "items": "minecraft:firework_star",
                    "components": {
                        "minecraft:firework_explosion": {
                            "shape": "small_ball",
                            "colors": [
                                14429954
                            ]
                        },
                        "minecraft:custom_data": {
                            "fire_spell:1": {}
                        }
                    }
                }
            }
        }
    },
    "rewards": {
        "function": "broken_barriers:fire_spell_function_control_r"
    }
}

#
    "type": "minecraft:crafting_shaped",
    "show_notification": true,
    "category": "misc",
    "pattern": [
        "aba",
        "cdc",
        "aba"
    ],
    "key": {
        "a": [
            "minecraft:magma_cream"
        ],
        "b": [
            "minecraft:blaze_rod"
        ],
        "c": [
            "minecraft:blaze_powder"
        ],
        "d": [
            "minecraft:nether_star"
        ]
    },
    "result": {
        "id": "minecraft:firework_star",
        "components": {
            "minecraft:firework_explosion": {
                "shape": "small_ball",
                "colors": [
                    14429954
                ]
            },
            "minecraft:custom_data": {
                "fire_spell:1": {}
            },
            "minecraft:custom_name": {
                "text": " Spell",
                "color": "#dc2f02",
                "italic": false
            },
            "minecraft:tooltip_display": {
                "hidden_components": [
                    "minecraft:firework_explosion"
                ]
            },
            "minecraft:consumable": {
                "consume_seconds": 0.05,
                "animation": "none",
                "sound": "minecraft:item.firecharge.use",
                "has_consume_particles": false
            },
            "minecraft:lore": [
                {
                    "text": "Mana Cost: 7 Points",
                    "color": "white",
                    "italic": false
                }
            ],
            "minecraft:piercing_weapon": {},
            "minecraft:enchantments": {
                "broken_barriers:fire_spell_left_click_detection": 1
            }
        },
        "count": 5
    }
}

lyric quartz
#

so did this advancement work on a version of this item without the left click detection, or have you only tested this as is?

night fable
#

it worked before the left click came in.

lyric quartz
#

apologies for the delay, but i'm testing now and its working fine for me. are you sure your advancement isn't already granted and that the reward function itself is working properly?

night fable
#

Hnmm. I will try to bugfix it later.