Hello in this video we are going to use a book to run some commands now we’ve done that before by giving the player a book which had text in they could click on this time we’re going to do it a little bit different we are going to check what text the Player writes themselves into the book so we will execute if entity at the nearest player and the command i’m going to run will be say hi we could have any command there we want we could place a redstone block somewhere to open a door we could give them a regeneration effect Anything you want i’m just going to say hi we’re going to check the players nbt data and the nbt data i’m going to check will be the selected item and in the selected item i’m going to want to check a tag and the tag i’m going to check will be The pages so we’ve pretty much narrowed it down to only be a book now because nothing else has pages and i’m going to check the first page for a piece of text and i’m just going to check for hello done turn it on there’s my book it’s selected nothing’s happening We’ve got nothing on the first page let’s write hello done now it’s running and it’s going to keep running as long as that’s selected let’s deselect it now it’s not running and we go back it’s running again okay let’s clear the book let’s pop down another command block We’re going to make it always active and a chain and it’s going to be conditional and we will do item replace entity the nearest player weapon dot main hand so that’s effectively their select their selected item and i’m going to replace it with air now if this runs and is successful Because this is conditional we will take the book away the book’s gone because it still had the word hello in it let’s give ourselves a new book there’s my new book nothing’s happening let’s say hello done at the book’s gone and it says hi okay let’s copy this control and middle mouse button Make this one conditional as well and we won’t replace with their we’ll give them another writable book conditional yes let’s get myself a new book and book now hello the command runs the book gets taken away and a new clean book gets put in its place so there’s nothing in here so We can do the command again hello okay what i would probably use this for is something like a spell book as people progress through your level there you can have a sign saying you’ve now learned the spell i know regen and you could uh run and well we could run effect give At the player regeneration for five seconds with an amplifier five and we will hide the particles so now if i type hello done gives me a new book and it’s giving me regeneration level six for five seconds um so that’s it pretty simple really check the text run a command based on what Text they put in take away the book and give them a clean book so you could have lots of these on your map checking all sorts of different commands you could even link it to a scoreboard system so only if they’ve got a certain score could they Could they type something in and run the command and you could deduct the score each time sort of like spell power that’s what i would probably use it for and that’s it for this video Video Information
This video, titled ’82: Spell book [Minecraft Map Making]’, was uploaded by Infernal Device on 2022-05-01 12:23:05. It has garnered 130 views and 4 likes. The duration of the video is 00:04:01 or 241 seconds.
Ep82: Run commands based on what is typed into a book.
Originally for Udemy, but uploaded here. Commands, builds and ideas for people making their own Minecraft maps.
Check out my collabs on Coppit’s channel: https://www.youtube.com/c/CoppitJ
Join the server I play on and the Discord where I hang out. Server IP: 51.81.246.145:25588 Discord: https://discord.gg/KNSmPWdnfG
Udemy notes. YouTube formatting may make some of these wrong. 🙂
Commands used: Check the book text: execute if entity @p[nbt={SelectedItem:{tag:{pages:[“power”]}}}]run setblock 30 56 14 redstone_block replace
Remove the book: item replace entity @p weapon.mainhand with minecraft:air
Give an empty book: item replace entity @p weapon.mainhand with minecraft:writable_book