Right Click Detection just got 10x better

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 พ.ย. 2024

ความคิดเห็น • 114

  • @conure512
    @conure512  2 หลายเดือนก่อน +59

    No, you can't just make the item give back an identical copy of itself with use_remainder in order to apply a cooldown. You'd have to use the advancement/function with a give command if you were gonna do that.
    The problem with the component is that the copy would then need to also have a component which gives back a copy, and then that copy would also need it... and so on. You'd need an infinite amount of data to make it work. (As opposed to Loot Tables, where you can do some tricks to make them actually recursively reference themselves)

    • @supernexoscommands1571
      @supernexoscommands1571 2 หลายเดือนก่อน

      I used command blocks to do this so I couldn’t use advancements and I made it give back the same item but with a custom data component and use a command to replace it every tick with the right click detector

    • @NotBigSurprise
      @NotBigSurprise 2 หลายเดือนก่อน +1

      you could, however, have it give you a dummy item, then detect said dummy item with an advancement to replace it with the usable item

    • @Aurora.Astralis
      @Aurora.Astralis 2 หลายเดือนก่อน +1

      I may be wrong so please correct me if I am, but can’t you just have your component that gives your copy run a function which then has the /give command (or maybe /item to have it go to the right slot) for the item
      Like would that not work (I very much have no idea what I’m doing I only have a very basic understanding of this stuff)

    • @LinusYaw
      @LinusYaw 2 หลายเดือนก่อน

      @@Aurora.Astralis I don't see a reason why it shouldn't. You can just /give every player with the advancement in a tick function.

    • @TheiBunny
      @TheiBunny 2 หลายเดือนก่อน

      as conure512 says, anything the player changes like custom names and/or enchantments, curses, dyes, trims, contents, etc... will be lost with this method of replenishing the item...
      instead - for items that you don't want to be consumed on-use; right now you're probably better off using a goat horn as the base item and customizing the instrument file it uses to change the cooldown length.

  • @conure512
    @conure512  2 หลายเดือนก่อน +139

    Fun Fact! This new system is not used by nearly as many vanilla items as you might think. Goat Horns and Ender Pearls have no use_cooldown component (it's hardcoded in both), the component is only present on Chorus Fruits; and the "animation" field is only used by potions. Yes, that's right, despite there being options for bow and spyglass animations, Bows and Spyglasses don't even use this component at all.

    • @TheiBunny
      @TheiBunny 2 หลายเดือนก่อน +16

      classic mojang 😂

    • @kyleyoung2464
      @kyleyoung2464 2 หลายเดือนก่อน +23

      That's actually so good of mojang to give us functionality they don't even use (yet)

    • @ratlinggull2223
      @ratlinggull2223 2 หลายเดือนก่อน +3

      I made a parrying dagger last update using a goat horn, but now I can hold it up indefinitely using new cooldowns XD

    • @TheiBunny
      @TheiBunny 2 หลายเดือนก่อน +12

      now waiting for them to realise not just food:{effects}, but potion_contents, suspicious_stew_effects and ominous_bottle_amplifier components are all redundant too and everything they do could be achieved with the consumable:{on_consume_effects} component by just adding a show_component flag to either show or hide the effects in the tooltip.

    • @BooleanDev
      @BooleanDev 2 หลายเดือนก่อน +1

      @@TheiBunnyprobably just hasnt been done yet as this is still a snapshot

  • @kyleyoung2464
    @kyleyoung2464 2 หลายเดือนก่อน +42

    I knew this video was coming as soon as i saw the snapshot 💀

    • @DarkHawking
      @DarkHawking 2 หลายเดือนก่อน +1

      I was about to post rhis exact comment, mojang already cooking with technical stufff

  • @IwrsTheKing007
    @IwrsTheKing007 2 หลายเดือนก่อน +29

    6:50 I mean the consumable also is for potions, so "can_always_eat":false only applies to food

  • @jupitersky
    @jupitersky 2 หลายเดือนก่อน +10

    First thing I did when all this was first implemented was make a craftable blaze wand that spawned chargable fireballs utilizing fire charges as ammo. I can't wait for more awesome stuff to be possible!

    • @nathanchen2824
      @nathanchen2824 2 หลายเดือนก่อน

      That sounds awesome! If you don't mind me asking, how did you make the wand use the fire charges as ammo?

  • @Compyler
    @Compyler 2 หลายเดือนก่อน +43

    You are the only person who scratches my oddly specific technical data pack itches ❤️ Really appreciate your videos!

  • @RavenRavel
    @RavenRavel 2 หลายเดือนก่อน +7

    "Can_always_eat: true" also describes me.

  • @datopgaming04
    @datopgaming04 2 หลายเดือนก่อน +12

    bro what this is actually crazy. an ACTUAL cooldown mechanic for functions is going to be so nice 😌 (at least for consumable items)

  • @Pacca64
    @Pacca64 2 หลายเดือนก่อน +4

    Enchantments are doing well too, really excited about throwing snowballs/eggs/etc. getting projectile enchantment support and enchantability being abstracted into a component! The potential to make fully customizable enchantable tools like wands or whatever is looking very possible next update!

    • @cakeyeater7392
      @cakeyeater7392 2 หลายเดือนก่อน

      I'm excited, but I am struggling to figure out how to modify item default components without commands

  • @PiercingSight
    @PiercingSight 2 หลายเดือนก่อน +2

    I'm so excited by what they're doing with all these components and functions. Datapacks are getting so dang powerful now~

  • @andreaspatsalides1914
    @andreaspatsalides1914 2 หลายเดือนก่อน +12

    Now I need left clicking detection

    • @conure512
      @conure512  2 หลายเดือนก่อน +9

      We've already KINDA got that with enchantments detecting left-clicks on blocks, but left-clicks in the air are still just barely out of our reach lol

    • @JoZaHandle
      @JoZaHandle 2 หลายเดือนก่อน +4

      Interaction entity in front of players head?

    • @conure512
      @conure512  2 หลายเดือนก่อน +7

      @@JoZaHandle Yes, but then you've gotta, yaknow... keep it there lmao
      also it blocks the player's normal interaction abilities

    • @nati0598
      @nati0598 2 หลายเดือนก่อน +1

      @@conure512 Is it possible to keep it just far enough for the player to reach after everyhing else?

    • @cakeyeater7392
      @cakeyeater7392 2 หลายเดือนก่อน +2

      ​​@@nati0598 if you increase the player's block interaction range attribute by one, you could technically place it behind the furthest block you can reach normally.

  • @cupofglass
    @cupofglass 2 หลายเดือนก่อน +1

    you're a real one for including the datapack file

  • @dyrania
    @dyrania 2 หลายเดือนก่อน +1

    Love how this comes out hours after I learned about it.

  • @supernexoscommands1571
    @supernexoscommands1571 2 หลายเดือนก่อน +2

    If you’re trying to do this with command blocks (so you can’t use advancements) you can make it actually consumed on use and make the item give you an effect with the food component and then detect that effect and replace the item

  • @findot777
    @findot777 2 หลายเดือนก่อน +8

    I wonder if we will ever get a good left click detection

  • @Kars._spdr
    @Kars._spdr 2 หลายเดือนก่อน +5

    Alright good just what we needed

  • @vicchang530
    @vicchang530 2 หลายเดือนก่อน +5

    damn ive likely created a weapon pack with old one detection, now I have to change AGAIN

  • @ThoronSage
    @ThoronSage 2 หลายเดือนก่อน +2

    All we need now is custom item components and data for ingredients in recipes...as well as support for custom blocks and entities (Yes, it's already possible to make those. Still, having actual support would for those would be sick).

    • @donutstudios6353
      @donutstudios6353 2 หลายเดือนก่อน

      technically we dont even have official support for custom items the way of making them is still technically a workaround

  • @d2dog933
    @d2dog933 2 หลายเดือนก่อน +1

    oh boy oh boy this is gonna get fun

  • @KosinsStuff
    @KosinsStuff 2 หลายเดือนก่อน +1

    Oh my god finally i can make my Megumin staff even better

  • @eliasthememelord
    @eliasthememelord 2 หลายเดือนก่อน +2

    More right click detection lets go

  • @luigitime34
    @luigitime34 2 หลายเดือนก่อน +1

    You snuck in the PhoniexSC quote and thought we wouldn't notice...

  • @kyleyoung2464
    @kyleyoung2464 2 หลายเดือนก่อน +3

    Mojang should differentiate consumable and useable items.

  • @404maxnotfound
    @404maxnotfound 2 หลายเดือนก่อน +1

    Also the fact that minecraft:use_remainder got added is pretty cool, you could have that blaze powder spell get replace with charcoal with consume seconds are up, or maybe you could have a 'loot bag', once it's consumed gives you a container/item with a custom loot table.

    • @colon44
      @colon44 17 วันที่ผ่านมา

      loot bags are doable with Bundles, no?

  • @amthystxx
    @amthystxx 2 หลายเดือนก่อน +2

    These changes are pretty epic :)

  • @lilyzzworld
    @lilyzzworld 2 หลายเดือนก่อน +2

    thanks for explaining this!

  • @hatersheadquarters5264
    @hatersheadquarters5264 2 หลายเดือนก่อน

    Only man excited for item components

  • @docdapper
    @docdapper 2 หลายเดือนก่อน +4

    I was expecting a video about this lmao
    Mojang has been hitting it out of the park with their datapack stuff lately. We’re eating good!

    • @PotatoTheProgrammer
      @PotatoTheProgrammer 2 หลายเดือนก่อน

      why doesnt mojang just let us register custom blocks :(

    • @KBRoller
      @KBRoller 2 หลายเดือนก่อน +1

      Now we just need to be able to specify custom components on input ingredients in custom recipes...

    • @KBRoller
      @KBRoller 2 หลายเดือนก่อน +1

      @@PotatoTheProgrammer Because that's much more difficult, code-wise, than you might think, given all the different possible block properties and behaviors.

    • @Wawwior
      @Wawwior 2 หลายเดือนก่อน +1

      @@KBRoller mostly its about performance too, since you know all the registries are locked and baked every time you load the game. Having datapacks change it dynamically is hella error prone

  • @amotoz
    @amotoz 2 หลายเดือนก่อน +2

    Surprised you haven’t made a video about goat horn rcd, seems cool for custom abilities with a cooldown

  • @As1anCr4ck3r
    @As1anCr4ck3r 2 หลายเดือนก่อน

    if they add a way to make custom usage animations in Java resource packs all my dreams would come true and I would implode of happiness. This has to be the most amazing snapshot for custom items/powers in minecraft

  • @the10ofdiamondscard
    @the10ofdiamondscard 2 หลายเดือนก่อน +1

    I'm really hoping they change the cooldown so that it's upon use or give us the option so we can choose when it gets applied. Still a great snapshot, though.

  • @Totally_Bonkers
    @Totally_Bonkers 2 หลายเดือนก่อน

    wow, they really decided to treat me specifically. Yeah I know they didn't actually, but they even added a tempt range attribute, something I was trying to do a while ago. gonna be annoying to redo all the commands, but it'll be cool once i do

  • @hagangray8006
    @hagangray8006 2 หลายเดือนก่อน

    This absolute madlad seems to use notepad to edit data packs, respect++

    • @donutstudios6353
      @donutstudios6353 2 หลายเดือนก่อน

      same i use notepad lmfao

  • @mr3colio661
    @mr3colio661 2 หลายเดือนก่อน

    I'm making a minigame about magic an now I'm glad I haven't made the wands yet. I just have 1 or 2 items to fix.

  • @LinusYaw
    @LinusYaw 2 หลายเดือนก่อน

    I feel like we don't need server plugins in a few years anymore

  • @itzmqximingame
    @itzmqximingame 2 หลายเดือนก่อน

    dang thats awesome

  • @AspieGamer13
    @AspieGamer13 2 หลายเดือนก่อน

    I’m still learning these more advanced functions and whatnot, and I want to be able to do several things, but not sure how:
    Decrease bow draw time
    Detect which side of a block is being mined
    Mine additional blocks when mining
    I have small bits figured out, but the bulk of it I’m still not sure of
    I’m also hoping to do as much of this as possible as directly as possible

    • @conure512
      @conure512  2 หลายเดือนก่อน

      Decrese Bow Draw Time - Pretty sure it's not possible, that enchantment component is specifically for crossbows.
      Detect Side of Block - Again, not possible in any "official" way - you'd have to use raytracing, which is a somewhat complicated technique that I covered in my second video ever on this channel
      Mine Additional Blocks - You can detect the initial hit using a component, but not the actual breaking action. You'd basically need to use ticking commands that are constantly looking for a scoreboard objective that detects when you broke a block.

  • @humanharddrive1
    @humanharddrive1 2 หลายเดือนก่อน

    pretty great stuff

  • @amthystxx
    @amthystxx 2 หลายเดือนก่อน +2

    I find it interesting that Mojang contradicted themselves with the cooldown change. If I recall correctly, the goat horn cooldown starts as soon as the player clicks, so I wonder if this is a bug.

    • @conure512
      @conure512  2 หลายเดือนก่อน

      This cooldown system is based on Chorus Fruit specifically, which only starts after you're finished eating it. I know this because Chorus Fruit is the only item in the game, to my knowledge, that actually uses this new system. Goat Horns don't.

    • @amthystxx
      @amthystxx 2 หลายเดือนก่อน

      @@conure512 Interesting.

    • @cakeyeater7392
      @cakeyeater7392 2 หลายเดือนก่อน

      ​​@@amthystxxgoat horn is an instrument, not a food. If I'm not mistaken, instrument's cooldown is tied to how long you want the sound to play (so you can't overlap sound events)

    • @amthystxx
      @amthystxx 2 หลายเดือนก่อน

      @@cakeyeater7392 Yeah true. It would be cool if they added a parameter that makes it trigger as soon as you click, though.

  • @TheiBunny
    @TheiBunny 2 หลายเดือนก่อน +2

    with the changes to the food component, I'm wondering how existing dummy items (like a poisonous potato) with "!food:{}" are updated..
    whether it will automatically be made non-consumable because it wasn't before, or if it will have to be manually updated to remove the consumable component...

    • @conure512
      @conure512  2 หลายเดือนก่อน +1

      @@TheiBunny Exactly, you'll now have to remove the consumable component to prevent it from being consumed. This may very well cause upgrade issues for existing items, I have yet to test that

    • @TheiBunny
      @TheiBunny 2 หลายเดือนก่อน +1

      @@conure512 thanks to the massive changes to items between 1.20.4 and 1.20.5, I've already had to make my own custom data fixer for my old items anyway so its not a huge deal for me to have to update them again...I'd just prefer not to 😅

  • @lexbeukel9949
    @lexbeukel9949 2 หลายเดือนก่อน +1

    Hi, I love this, but can you make a tutorial on how to do it without data packs? (If its possible) I just like command blocks more, thanks

    • @bloxxer_tv
      @bloxxer_tv 2 หลายเดือนก่อน

      All of the files used can be replicated in regular commands! The command syntax just looks different.
      Here’s an example:
      /give regfunkid apple[consumable={sound:entity.blaze.hurt}]
      That command gives you (or me, since that’s my username) an apple which, when eaten, makes an awful noise.

  • @jgchgdut8327
    @jgchgdut8327 2 หลายเดือนก่อน +1

    hallo im very impressed with your video but i have questions
    do yo have any way to make when you type it shows you a reverse.
    im very need that thing.
    keep going 💥💥💥💥💥💥💥♥️♥️♥️♥️

    • @conure512
      @conure512  2 หลายเดือนก่อน +1

      not gonna lie i have no idea what you're asking here, but thank you!

  • @thefanboy3285
    @thefanboy3285 2 หลายเดือนก่อน +1

    HOLD UP !
    Dose this new animation component mean that we can have back the pre 1.9 sword blocking ?

    • @conure512
      @conure512  2 หลายเดือนก่อน +2

      I'm not sure if that one is an animation that's available, the "block" animation looks like how shield work and also doesn't seem to do anything at all in first person. It totally could become available in the future though

    • @thefanboy3285
      @thefanboy3285 2 หลายเดือนก่อน

      @@conure512 awww... And here I was hoping the block animation did that.
      If it's not too much for me to ask you, could you fill a suggestion form to have the old_sword implemented in a future snapshot? I would've done it myself but my Minecraft is « less than legal » which I assume will render my opinion voided. Also the animations for other player-like entities like Evokers' arms waving

    • @donutstudios6353
      @donutstudios6353 2 หลายเดือนก่อน

      I've already made a datapack in 1.21 that adds back sword blocking and 1.8 mechanics so it's possible but now it can be made less janky

  • @min0907
    @min0907 2 หลายเดือนก่อน +1

    Hey im new at the datapack making, can someone show me how does the "apply_effect" inside of the "consumable" component work?

    • @bloxxer_tv
      @bloxxer_tv 2 หลายเดือนก่อน +1

      Sure! It’ll look a little messy in a youtube comment but you can just copy this:
      [consumable={on_consume_effects:[{type:apply_effects, effects:[{id:(effect),duration:100,amplifier:0}]}]}]
      The easiest way to remember writing it is that “on_consume_effects” requires a *list* ([…]), followed by an *object* ({…}) which contains a “type” of effect application, in this case being “apply_effects”. After the type you need to then provide a list of effects in another *list* followed by another *object*.
      The first list ([…]) is for all your effect application types. The item can do multiple at once, not just one effect at a time.
      The second list is for each effect, separated by objects ({…}). The *amplifier* and *duration* areas are optional, but remember that *duration* is written in GAMETICKS, not seconds. So to make it last the time you want, calculate (time) x 20 = (result).

    • @min0907
      @min0907 2 หลายเดือนก่อน

      @@bloxxer_tv tysm!! i was making two lists lol

  • @Rikaisan
    @Rikaisan 2 หลายเดือนก่อน

    Didn't Mojang do something to goat horns on 24w33a to be able to make them fully data driven and configured in datapacks? I was wondering if it was possible to use that for cooldowns and right click detection...

    • @conure512
      @conure512  2 หลายเดือนก่อน

      @@Rikaisan Technically yes, but for some reason that still doesn't work with any item other than goat horns. it's just that you can make your own sounds now

    • @Rikaisan
      @Rikaisan 2 หลายเดือนก่อน

      @@conure512 Sorry if I'm ignorant, I'm not really a datapack dev, however, isn't it possible to use ma goat horn as a dummy item, use it for right click detection and use the `use_duration` field for cooldowns?

  • @thanasisbrs4004
    @thanasisbrs4004 หลายเดือนก่อน

    Just an idea. What if you had an item that is instantly eaten, then you do what is supposed to do but after that you schedule to give the player back the item at the end of the duration of the scheduled command.

  • @Variant404
    @Variant404 หลายเดือนก่อน

    Did you ever figure out how to edit the animations with a resource pack?

  • @antekacki8753
    @antekacki8753 2 หลายเดือนก่อน

    3:55 how about making the item conusmable, but simply with using the "use_remainder" to leave itself?

    • @sealedtugboat9965
      @sealedtugboat9965 2 หลายเดือนก่อน +1

      You’d just be making a Russian doll. 🪆eventually you’d reach the last layer.

  • @enderallygolem
    @enderallygolem 2 หลายเดือนก่อน

    How long until we're able to run a function on consume to skip having any advancements?

    • @conure512
      @conure512  2 หลายเดือนก่อน

      @@enderallygolem This snapshot already has some on-consume effects, but most of them just have to do with granting or taking away potion effects. For now, at least.

  • @Bedrock_Armor
    @Bedrock_Armor 2 หลายเดือนก่อน

    regarding the cooldown not working as you'd hoped on items that aren't consumed, couldn't you have the item be instantly consumed and have the advancement give back an identical copy of the item when you do? it's probably not perfect but I think it'd still work fine
    I can't quite think of a workaround that'd get the exact behavior desired for the impulse gem though

  • @nathanchen2824
    @nathanchen2824 2 หลายเดือนก่อน

    Is it possible to modify how long it takes for the bow animation to show it as fully drawn?

    • @conure512
      @conure512  2 หลายเดือนก่อน +1

      Not at the moment at least. The animations are hardcoded.

  • @QuantumDeity
    @QuantumDeity 2 หลายเดือนก่อน

    I dont know id this would work, but could you set the result item to be the same as it was before? Therefore making the burst gem work?

    • @conure512
      @conure512  2 หลายเดือนก่อน +1

      That's actually a great idea, BUT, the only drawback is that it would erase any custom data that the player had applied like renaming in an anvil.

    • @Napaddd
      @Napaddd 2 หลายเดือนก่อน +1

      @@conure512 and dont you also have to make the result item have the result item have the result item and so on?

    • @conure512
      @conure512  2 หลายเดือนก่อน

      @@Napaddd actually that's a very good point lol. with Loot Tables, infinite recursion is super easy, but they dont let us use those here lol

    • @donutstudios6353
      @donutstudios6353 2 หลายเดือนก่อน

      @@conure512 how about use a 'using_item' advancement trigger and it will run a function that uses an item modifier that will modify nothing in their item except set the count to 1 (even if it's already 1) i think that would work

  • @TenCowStud
    @TenCowStud 2 หลายเดือนก่อน

    Is there any way to make it so it doesn't slow you down?

    • @donutstudios6353
      @donutstudios6353 2 หลายเดือนก่อน

      maybe use a using_item advancement trigger to run a function to set their movement speed attribute and reset it when they arent but that's kinda janky and will change the player's FOV

    • @bloxxer_tv
      @bloxxer_tv 2 หลายเดือนก่อน

      You can get around it by making your item be used instantly, but instead have a cooldown applied after use.

  • @Death_Tr00per58
    @Death_Tr00per58 2 หลายเดือนก่อน

    This disappointed me a bit, not because the change isn't amazing but because it can not be done without data packs.

    • @bloxxer_tv
      @bloxxer_tv 2 หลายเดือนก่อน

      You can do this with commands! You just lose a lot of things (like custom recipes) without a data pack.
      That being said, data packs are REALLY easy to make, so give it a try!