Dismiss Notice
Wynncraft, the Minecraft MMORPG. Play it now on your Minecraft client at (IP): play.wynncraft.com. No mods required! Click here for more info...

"easy" Right-click Detection

Discussion in 'Minecraft' started by Quint, Jun 24, 2018.

Thread Status:
Not open for further replies.
  1. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    Sooooooo...... I was bored and decided not to work. I realized, "Hey! The only truly practical way for right-click detection in vanilla is with carrots on sticks and if i want to make an adventure map, I'm going to need a SHITTON of carrots on sticks for all the right clickable items I want, AND I can only make one if i want it to have a custom texture. These are problems. What is the solution? Block Models! So, using the models in the wynnpack that override item textures, it'll look gud. So, the model for a diamond block is a wand. When i right-click with a diamond block, it'll place a diamond block. Basically, all i need to do is run a /testfor command constantly for that diamond block, then do whatever commands i want on rightclick and delete the block to not repeat it. So yeah, I just made a new system to make any block a right-clickable custom item. Fun. I'm working on left- click detection. Ultimate goal- Right | Left combos (Which i doubt i can do). The biggest problem is currently I have to test every block around the player individually.
     
  2. Linnyflower

    Linnyflower ironman btw Item Team HICH Master CHAMPION

    Messages:
    3,473
    Likes Received:
    4,012
    Trophy Points:
    192
    Guild:
    Minecraft:
    ...or ask a dev how the system works.
    wait.
    How does the system work?
    invisichests?
     
  3. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    What no the goal is for singleplayer, no mods, no plugins versatile right-click detection made PURELY out of CMBs. The system im developing (with CMBs) uses remodeled block item textures to disguise it as smth else, then testing for that type of block being placed. If the test comes back positive, then I execute whatever CMDs i want.
     
    Aya likes this.
  4. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    147
    Guild:
    Minecraft:
    You do realise you can make like 60+ textures for carrot on a sticks?


    The more common right click detection however is honestly wool on a sheep if you don't want carrots.

    [Invisible sheep in front, dye in your hands and dye the sheep]
     
    coolname2034 likes this.
  5. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    Yes but i aint no nerdd immat gon figure out how to texture all those seperately.
     
  6. Stormarend

    Stormarend The classes DO NOT correspond with the elements.

    Messages:
    1,480
    Likes Received:
    2,887
    Trophy Points:
    162
    Minecraft:
    I believe it's possible to trak if a player talked to a villager, even if it has no trades, effectively making it a right-click detector. It is a bit messy though if you wanna use it like that, with mob teleportation and such.
     
  7. (Meric)

    (Meric) No longer edgy

    Messages:
    3,194
    Likes Received:
    2,753
    Trophy Points:
    147
    Guild:
    Minecraft:
    There is indeed a scoreboard start I do believe that tracks how many times you talk to a villager.

    But that requires an invisible floating villager to be infront of you
     
  8. DrBracewell

    DrBracewell Famous Adventurer QA Modeler GM CMD

    Messages:
    1,086
    Likes Received:
    1,905
    Trophy Points:
    151
    Creator Karma:
    Guild:
    Minecraft:
    I retexture carrot on sticks to blank textures, then do this-

    - If holding item that needs right-clicking

    - Set the blank carrot on a stick to the offhand

    - Detect right click

    - Clear carrot on a stick.

    Note: make sure to have a not gate to clear the carrot on a stick when your not holding the item
     
  9. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    Oh so it detects right clicks in off hand and I could use a test for clock to check if it's been rightclicked and then an and gate if it has the right item uhhh I'm dumb or at least I could if they didn t fucking change execute, the entityselectors, testfor, scoreboard AND to whyyy 1.13 I liked you and autocomplrte but then you fuck me over like this not cool 1.13 not cool broski
    ________________________________
    wait fucc whats the entity selector for the offhand item ughh why am i so dumb
     
  10. DrBracewell

    DrBracewell Famous Adventurer QA Modeler GM CMD

    Messages:
    1,086
    Likes Received:
    1,905
    Trophy Points:
    151
    Creator Karma:
    Guild:
    Minecraft:
    uhhhhhh slot.weapon.offhand?
     
  11. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    No No with entity selectors as in @p[r=5,score_confusion_min=6]. I guess I could try scoreboard tagging and execute from there.
    ________________________________
    Like can you have the off hand as a entity selection variable?
     
  12. DrBracewell

    DrBracewell Famous Adventurer QA Modeler GM CMD

    Messages:
    1,086
    Likes Received:
    1,905
    Trophy Points:
    151
    Creator Karma:
    Guild:
    Minecraft:
    ? Here’s how I do it: let’s say I want to detect if I right click with a green dye:

    Repeating CMD:
    - Tests if I am holding the green dye

    Conditional Chain:
    - Sets offhand to carrot on a stick (using /replaceitem)

    Conditional Chain:
    - Powers another CMD chain (see below)

    Conditional Chain:
    - Sets the redstone block that powers this chain to air (important that this is last)



    OTHER CHAIN:
    (You need to have set up 2 scoreboards, one that tests for a carrot stick right click (stat.useItem.minecraft.carrot_on_a_stick), I've called that "CarrotTest", and one dummy (I've called that RightClick)

    Repeating CMD:
    - /scoreboard players set @a[score_CarrotTest_min=1] RightClick 1

    Chain Conditional:
    - Clear the carrot on a stick (/clear)

    Chain Conditional:
    - Do whatever you want the right click to do (Usually this CMD just powers another chain using /setblock or /blockdata)

    Chain Conditional:
    - /scoreboard players reset @a[score_CarrotTest_min=1] CarrotTest

    Chain Conditional:
    - /scoreboard players reset @a[score_RightClick_min=1] RightClick

    Conditional Chain:
    - Sets the redstone block that powers this chain to air (important that this is last)

    That's how I do it. It could probably be compressed into one chain, but I'm not that smart
     
  13. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    Ahh I see.
     
  14. Quint

    Quint least estrogenated scripter HERO

    Messages:
    1,134
    Likes Received:
    2,603
    Trophy Points:
    162
    Minecraft:
    P
    Ooh just tested, works like a charm, much thanks.
     
  15. Strelitiza

    Strelitiza Newbie Adventurer

    Messages:
    11
    Likes Received:
    1
    Trophy Points:
    2
    Minecraft:
    Right clicks are very usful
     
Thread Status:
Not open for further replies.