RIGHT CLICK DETECTION GUYS Tutorial Datapack - drive.google.com/file/d/1gA33... Turns out, we do have full right-click detection • I was wrong. Right Cli... it would be p cool if u joined the discord / discord
Couldn't you have the function that summons the fireball also give you another book? It'd sometimes be placed in a different inventory slot which is annoying, but it might be usable.
Exactly, it might not go into the right slot, and it would also remove any custom data the player might have added (such as renaming). So yes, doable, but potentially annoying lol (im pinning this because apparently a LOT of people have the same question) To those asking "Can't I use just /item replace instead of /give": There's no way to detect which slot you used the item from (mainhand or offhand), and if the item is stackable you run the risk of overwriting the rest of the stack. So you'd have no choice but to use /give.
@@conure512 can't you use the /item command to replace your weapon.mainhand slot with the knowledge book? (/item replace entity weapon.mainhand with minecraft:knowledge_book)
@@conure512hey I’d say this opens up the possibility of putting a delay on the spell so players can’t spam op spells. I know that I’m not a datapack devs and this sort of implementation can run into problems such as “what if they get their inv full before the cooldown is up” and stuff, but its an idea
Could replace the item with a cooldown item that then gets replaced once the cooldown is over, if you are doing a minigame where the item is tied to a slot, which is a lot of cases I wonder if its possible to copy the data of the item and replace it after the cooldown? Finnicky
@@conure512 Could you also increase the stack size with the new component system? Assuming the player only had one stack, it would go in the right spot if it had a place to stack
The fact that it is consumable is so great, it replaces using snowballs which had to use a ticking command or ender eyes which only worked in the overworld
I know! Consumable right clicks are still very useful and there's definitely a demand for them so this will fill a very good niche, even if it's not the holy grail of "tickless universal right-click"
It's right-click AND consumable? This is incredible, you can make magic spells come in bulk with one craft, and make healing or buffing spells! It's a drawback, but it opens the door to new features!
if you really wanted to make a re-useable spell (something like a tome) you could write a function to re-add the item to your inventory after use, then you could make it cost xp or health to consume so it wouldn't be too op!
@@k0rruptd That definitely works! One issue is durability, it has to be either very weak or very expensive to make it balanced. I personally would add a cooldown between uses as well as a xp price.
@@k0rruptd Yes! This is totally something we could do, actually my Magic Mirror pack does something similar when it detects that you've used the eye of ender. The ONE potential downside to this method is that there's no way to detect which slot you used the item from (mainhand or offhand), and if the item is stackable you're forced to use /give rather than /item replace (so as not to delete the rest of the stack), so the item might jump around in your inventory when you use it lol. The magic mirror does this as well.
You can make a knowledge book activate without assigning it a certain uncraftable recipe, just detect what extra properties it has (say a custom item tag) and then check if the player has used a recipe book that has that tag
@@CesarGpe Unfortunately i think so, but skill issue if someone makes a datapack that gives you every recipe in the game with /recipe give anyway instead of modifying the recipe advancements lol
Another rightclick detection u can use in 1.20.5 is giving your item the new food component set the eating time very very high and just create an item_used advancement... cons: Player could eat the item when holding right click for a week or so... You will be slowed down...
Right, it would require the using_item trigger (i desperately wish that item_used was an actual thing because then we could use advancements for the carrot). i would probably wanna avoid this personally tho, because it would play the eating animation lmao
@@conure512oh yea i misremembered the advancement name... about the animation: not when you set the eating time to the maximum of 2147483647... the animation is bound to how long it takes to eat an item...
@@Satwr I just went and tested this - turns out you're right! If you set the eating time to a high value, the initial arm animation slows down. That's huge my dude, thanks for pointing this out
This is crazy, I saw your next video first and the speed of how fast we’re learning new things with components is wild. Rlly feels like this update is on the level of Command Block Minecarts
they should have made it so knowledge books can grant any advancement, considering that recipes are normally granted by advancements anyway, that way you wouldn't need the recipe.
Great Vid! One other thing: an ender eye can be used with an advancement for a similar effect. Only drawback is compatibility with survival worlds; otherwise, in 'No structure generation' worlds, it works great.
This is actually exactly what I've been trying to accomplish, I have consumable books that increase a certain stat for the player and this achieves it with way fewer commands running. Awesome!
LOL, first time I've heard that one. though I do tend to agree actually, white noise in general is just overall pleasant. no for the record it is not on purpose, my computer fan is just way too loud lmao
Quite a eazy fix for using it, is having the fuction use /item to replace your mainhand back with the book. Only issue is detecting if you used it in your offhand. So not a perfect solution.
this is my first video from you, but PLEASE do me a favor and record your audio in Audacity, and use the noise removal tool if you NEED to have your mic volume loud. The white noise is distracting
I have been using Knowledge books for a couple years now, and they are great. I did not however know about the recipe detection. I just used a scoreboard for tracking uses. So thanks.
I ran into this a couple versions ago. You can get around the consumable issue by placing the item back into the player’s empty hand. There is then the issue of then using it in an offhand, but I’m sure there’s ways to detect it.
Ok, I’ve got it. Have an advancement that is given when the player is holding a scroll in the hand/offhand that sets a flag and stores the nbt in storage. When they use the spell, check which flags have been set, sets the item, and changes the nbt back.
Sure, that NBT method could work! Although the inventory_changed trigger doesnt detect when you change your selected slot, so you'd have to introduce a tick to detect the mainhand change... at that point it might be worth it to just accept your fate and use a carrot on a stick haha
I think it would be wuite fun if they gave you an option later for a "search recipe survival" where you have one book and have to expend some resources to use them making the search books. I think it would be quite funner. Or, if not that, make the player start with the craftings of processed wood, crafting table, paper and the book or something like that. Minecraft doesn't really has the factor gameplay, and i think it would make the game more fun to play, but being an optional for those who want to play for the long-run maybe making use of the new biome blocks. Idk.
before watching this video, i was actually contemplating using bad luck potions and predicate effect duration detection, to unlock recipes for my limited crafting datapack. But well you know. apparently there are already recipe items. Now I swear I knew they were used for custom crafting, it just never occured to me, that they had an intended purpose too. (But recipe potions still sound cooler)
Another way i think minecraft could make knowledge books slightly less useless is to actually have knowledge books with random or not so random recipes spawn in chests because i swear i still have to look up how to craft a blast furnace in google because i have no idea what its made from and i dont have the items for it so i never unlocked the recipe. It would be a way for new players to unlock recipes in the early game they would otherwise never know how to make... Just a thought
Forget the blast furnace. The stonecutter is an actually useful block and I had to Google it several times because I didn't know what the recipe was. The whole point of the recipe book was to make Google not a necessity, but it still ended up being a necessity...
The part about it triggering instantly isnt correct. While its true that advancements trigger at any point in a tick, "player used item" is only checked for once per tick. Also, iirc, unless you are doing something with subticks, it wont make a difference like in your example with /summon, since that wont be rendered to your screen or be interactable until the next tick anyway
It's funny because I paused this video after a minute to go mess with Minecraft ideas I had, then I was trying to figure out if there was a way to do simple and efficient right click detection. I was disappointed by the complexity and inefficiency of a custom setup, so I quit the game and went back to this video, only to find out all my problems are solved by this book with some simple tweaking. Very neat! And very ironic.
Advancement aren't instant, they don't trigger at the exact time when you click, they also get tested once per tick but not at the same time IN the tick. (I don't know the order by heart so I'll totaly make that order up) For example, you can have the recipe unlocked advencement kind, then the recipe crafted, then the tick advancement, then the functions, and then the player_interacted_with_entity The reason why it can be useful is that all advencement aren't tested every tick. For example, if you haven't unlocked any recipe this tick, then none of the "recipe_unlocked" will be tested
Can you modify the max stack size from 1 to 2 and set the stack size to 2 before the item is removed? This could allow for reusable (and very spammabke spells that don't need to worry about moving into a different inventory slot.
Perhaps being consumable is fine and actually a feature. We can make recipes that yeild a certain number of books. Maybe a whole new potion-like or rocket-like system where adding more paper or something to the recipe gives you more "charges"
Hey, if you don't want to do it consumable, why don't you just set the item in the player's hand to this book? Maybe it doesn't work like that, I don't know much about datapacks, but I know that you can write commands in them, and there is a /item command.
now make knowledge book that can summon moving train along with the railtrack then explode and after explode it will summon random minecfraft structure
couldn't you just have it to when you use it it adds a copy in the same slot of your inventory and this could be used for cooldowns like adding it back after a couple of seconds
Oh wow, I was not aware of this. Sounds like a bug, I might have to go report that lol Edit: It has been reported already! bugs.mojang.com/browse/MC-271005?jql=project%20%3D%20MC%20AND%20text%20~%20%22knowledge%20book%20consume%22
Yes, but this is awkward sometimes, especially if you need to detect which hand you used the item from (if you used it from your offhand, it could jump to your mainhand, or even overwrite whatever was in your mainhand). Also, if you want to make the items stackable (which you can now do in 1.20.5), you'd have to use /give instead of /item replace, because replacing may overwrite the rest of the stack. In either case, the item could end up moving around in your inventory whenever you use it.
Bedrock players didn't really need it, you could always make custom crafting recipes in bedrock addons for a while now. i like the recipe book menu on java much better though.
Yes, but this is awkward sometimes, especially if you need to detect which hand you used the item from (if you used it from your offhand, it could jump to your mainhand, or even overwrite whatever was in your mainhand). Also, if you want to make the items stackable (which you can now do in 1.20.5), you'd have to use /give instead of /item replace, because replacing may overwrite the rest of the stack. In either case, the item could end up moving around in your inventory whenever you use it.
i live right next to a railroad track, this happens all the time. i just thought my reaction was kinda funny while editing so i impulsively decided to leave it in lmao
It didn't have explicit support, but players figured out a weird system with knowledge books. You had to add a custom recipe that generated a knowledge book (with no custom data). Then, you created an advancement that triggered when the player learned that recipe. Recipes are automatically learned the first time they're used, so using the custom recipe triggered the advancement for learning the custom recipe. *Then* in the reward function for that advancement, you had to clear the knowledge book out of their inventory, give them the item the custom recipe was actually supposed to craft, and clear the advancement so it will trigger the next time they wanted to craft the custom item...
@@the10ofdiamondscard I actually have a datapack that does this in an older version (the Magic Mirror), and yes, it requires two advancements: used_ender_eye for the overworld, and using_item for everywhere else. Needless to say I'm probably gonna change to a different system for that pack in 1.20.5 lol
I find it funny how all right click detection systems have a draw back lol Carrot on a stick is slow Endereye doesn’t work if there’s an end portal and now Knowledge book has to be consumed Mojang is not making this easy for us lmao
People keep saying fully-custom items are coming soon, im hoping they end up being right because that would SURELY allow for fully-customizable right click detection in some form or another.
@@conure512 I’ve been saying this for months but, why hasn’t Mojang already done this? We’ve been getting closer and closer but never quite reaching it despite Bedrock basically already having this already with behaviour packs lol
FAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKEFAKE they where added way before that.