HomeКомпьютерные игрыRelated VideosMore From: CrushedPixel

Get Selected Inventory Slot - Minecraft 1.8

410 ratings | 42890 views
Using the new @e Selector I managed to create a method to test which Inventory Slot in the Hotbar a Player has selected. Nice!
Html code for embedding videos on your blog
Text Comments (84)
THE SHADOW (9 months ago)
thanks a lot
Okapi (11 months ago)
yea
JakeTBP (1 year ago)
Does this work in 1.11?
Brian Botz (1 year ago)
Such a cool idea!
you
Hero (2 years ago)
how to testfor selected (SHIFT) ? /testfor @p {SelectedItemSlot:shift} yes & no ????
Hero (2 years ago)
tkas you
Evil Chicken Bros (2 years ago)
+Danh Nguyenla Well, there is a scoreboard detecting when you shift and one with the distance travelled using shift. These are: /scoreboard objectives add shiftTime stat.sneakTime (you can swap shiftTime for anything) and /scoreboard objectives add shiftdistance stat.crouchOneCm (the same rule applies). You can't do {SelectedItemSlot:SHIFT} because it is not a value or a slot but I hope that this wah what you were looking for! =)
2Captain Silent Gamer (2 years ago)
+Danh Nguyenla what wold this do check for the new hotbar that coms upp when you press shift haha
Ghost Pickle (2 years ago)
My internet right now!!!! GRRRRRRR
This thing does not test for the item. it testfor the slot what the player holding so if you dont give the player the "jump boost" item it will also give the effect and i want it to test for the item not the slot so if the palyer holds a specified item (does not matter which slot) it will give the effect. how can i do it?
Conner Merchant (2 years ago)
is there a way to make if you have this armor on you only get 10 slots but if you get this other armor on you get 20 slots or all?
You Can Just Use Attributes
xXOrionProGamingXx 12 (3 years ago)
In 1.8
xXOrionProGamingXx 12 (3 years ago)
CrushPixel can u make a video about Custom GUI?
Swiggity (3 years ago)
I have a idea ... TF2 in MINECRAFT :D !!!! I got this idea from the invisibility thing... sooo i thought that the spy can have that ability ( a item ) and make it look like a watch with a resource pack
Quinn Spitzer (3 years ago)
does anyone here know what i am doing wrong? Im using the command  /testfor @e[type=Player]{SelectedItemSlot:9} but it keeps saying  qspitzer did not match the required data structure I keep selecting slot 9, but this video and every other video i try keep end with the same result:qspitzer did not match the required data structure (P.S. im using 1.8.1)
Mr. Boden (2 years ago)
+Quinn Spitzer /testfor @a {SelectedItemSlot:8} the first slot is slot 0
thewew65 (3 years ago)
the hot bar does not range  from 1-9 it actually ranges from 0-8 so try this: /testfor @e[type=Player]{SelectedItemSlot:8}
Makilla.io (3 years ago)
Put A Space between the bracket and {
Heijianke (3 years ago)
Thanks! Now I can finish off my Hotbar doubler to use on a server!
Nathe .10x3 (3 years ago)
How do i make an item like a stick spawn a firework or a particle effect?
CyanStarLight (1 year ago)
This was posted a year ago, so you still need this info?
Jaden Vorster (3 years ago)
the particle are a problem so rather do this /effect @p minecraft:jump_boost 40 12 true   then it will hide the particles!
Mydris (3 years ago)
Minecraft vanilla bending like Avatar the last airbender or something
Ktmus2009 (3 years ago)
Thank you so much! I've been online searching for a Test for slot tutorial All Day! This is exactly what I wanted! +CrushedPixel
Kita S. (3 years ago)
why not use @a instead of @e[tyupe=Player]
SoggyWafflezz (3 years ago)
Great concept, but there is an easier way to set up the redstone there. I did a video on how to do it that's a little simpler. Still the same concept tho so doesnt really matter. :)
DarkSidious14 (3 years ago)
@e[type=Player]? You could just use @a 
Lego Mite (3 years ago)
[17:01:32] Legomite did not match the required data structure
Squid (3 years ago)
Doesn't work :/
Gaming kid chanel (3 years ago)
can you show how to build al this redstone things
TheOmega983 (3 years ago)
how to stop command blocks from writing in chat about what they are doing 
TheOmega983 (2 years ago)
+The Broodlord thanks
What is the song in this vid?
SpakeMiner (3 years ago)
Gosh... You don't need the @e selector to test for custom NBT tags... Since @e came, everyone used it ALWAYS, even for players. Everyone forgot about @a, @r and @p.:P
Cloud140 (3 years ago)
Hi, do you have idea how make some like this? On multiplayer: If player hold in 8 slot item "Recall" he will be teleported to the location. Of course, not nearest player @p, but only player who holding recall. How make this? I used  /testfor @p {SelectedItemSlot:8,Inventory:[{Slot:8b,tag:{display:{Name:"Recall"}}}]} and then, i don't know how make /tp @p[{SelectedItemSlot:8,Inventory:[{Slot:8b,tag:{display:{Name:"Recall"}}}]}]~ ~2 ~  can somebody help?
Michael Moralde (2 years ago)
+Cloud140 no
MKKL (2 years ago)
+Cloud140 o Cloud :D Widzę że się uczysz
ProRed (3 years ago)
+Cloud140 No Problem!
Cloud140 (3 years ago)
+ProRed Thats working! thanks ;)
ProRed (3 years ago)
you can do /scoreboad players set @a testobject 1 {Here you can put a Datatag!}
Aidan Seeberg (3 years ago)
How do i stop the mana regeneration after it hits 100?
Chat's7 (4 years ago)
Hi ! Do you know if we scan a item with a custom name in the hotbat ? For exemple, a nametag with the name : "Test" ? And the comparator which be activated only if the nametag got this name. And thanks for you're video, i've learn so much thing =)
Matt Jackson (4 years ago)
I am unable to run the main command used in this video ./testfor @e[type=Player]{SelectedItemSlot:0} (that was copied from the command block) I am running the newest snapshot is there something I missed?
Matt Jackson (4 years ago)
Thanks! I'll test it out!
Derputer (4 years ago)
Is it possible to have something to test if a certain item is in the inventory (in any slot), but only output a signal when someone is holding it?
Matt Jackson (4 years ago)
it's in a snapshot video by the way
Derputer (4 years ago)
okay! i'll take a look!
Matt Jackson (4 years ago)
yes Sethbing put a video out about this (or a later) snapshot. In the video he went over both the selected hot-bar slot and the item in said inventory spot
leonefoscolo (4 years ago)
Can I i teleport the player which have a specific item on the first slot?? please help me i'm doing a custom map! :D
SomTingRaimi (4 years ago)
I am the 2500 sub :)
GatFire (4 years ago)
What music did you use?!
ROBHIE (4 years ago)
can't you use this for target? example i made a clock for this CMD - /testfor @e[type=Player]{SelectedItemSlot:0} - put a comparator - output to a CMD with this command - clear @e[type=Player]{SelectedItemSlot:0}
ROBHIE (4 years ago)
i'm doing this kind of CMD CODE to make a CHOOSE SLOT TO COMMAND on my server btw i'm running the latest snapshot 14w02c
More 1.8 vids
Viktoria Arnaudova (4 years ago)
You said more videos where are these videos
Mapenter OnVidz (4 years ago)
Hey CP! I was just Building my custom map - i was creating scrolls (if a player right-clicks a map the scroll activates - gets cleared), but i had a problem - i want players to still be able to create maps - is that possible?
onlynamelefthere (4 years ago)
smart, well done!
Paul Wesley (4 years ago)
Dj Roc!! and cool design!
João Pinto (4 years ago)
there's something superlatively calm about your voice. even if you had bad ideas i'd still watch all your videos! :-)
Grynffender Grynf (4 years ago)
Explique stp
The Fist (4 years ago)
Thanks for this video! i had problems with NBT tags... now that this works,i have no problem :)
Big Park (4 years ago)
How do you put a cap on your maximum score
ItsJustJumby (4 years ago)
This is pretty neat!
Hippycow12 (4 years ago)
Dude this is incredible
sudh75 (4 years ago)
Can I get A world download plz?
RuRo (4 years ago)
The final thing that we need is a command that allows us to modify entity's NBT on the fly!
RedDumpster (4 years ago)
Can you make a chest to /blockdata command?
Reo Reyes (4 years ago)
for the clock, you can do it with one command block... command is /summon FallingSand ~ ~1 ~ {TileID:152}
coolinblah vid's! (4 years ago)
but its still not a block,so it wont power
Reo Reyes (4 years ago)
I forgot to mention, power it with a redstone block on top with that specific command and it will go as fast as the clock you have but without any particles
coolinblah vid's! (4 years ago)
since Falling sand is an enitity it wont power,and with that command,it will automacitly despawn
ArtisticPixel (4 years ago)
Dang, this is REALLY useful for map makers and I may find myself using this in the future! Thanks and great video... like usual
Nzy (4 years ago)
Map Download pls :D tis ist the right for my jetpack
ChannelVideoTest (4 years ago)
I have some problems with kill item. I want to delete speciffic items and not all items on the ground. Is there a way to delete just, for example a named snow Ball?
Evil Chicken Bros (2 years ago)
+ChannelVideoTest Well, you could run a scoreboard /scoreboard objectives add snowball dummy and then use a repeating command blocksset to always active and put /scoreboard players set @e[type=Item] snowball 1 {Item:{id:snowball,Count:1,tag:{display:{Name:"snow Ball"}}}} Then, when you want to kill any snowballs on the ground, type in the chat (use t or /) /kill @e[score_snowball_min=1] This will remove any snowballs on the ground named snow Ball. I hope this helped!
ChannelVideoTest (4 years ago)
Please spontan, i need it for a concept video Take your time
CrushedPixel (4 years ago)
I will upload a video on that soon!
Nope. (4 years ago)
Does it detect what item are you holding? Btw cool!
CitrioN (4 years ago)
+GersinMC Not his one. I just uploaded a video that shows somewhat of a workaround for your problem :)

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.