I'm trying to make a jukebox not drop its disc but instead make the disc disappear so that I am unable to pick it up. Are there such possible methods of doing so? I have tried adding a command block that placed lava on the same block as the Jukebox and a command block that replaced the Jukebox so when the Disc falls out of the Jukebox it burns but if you stand near the jukebox it is still possible to get the disc which is something that I don't want.
-
Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins!– FrankCommented Jul 20, 2016 at 21:55
-
@Frank Yes I have, I added a command block that placed lava on the same block as the Jukebox and a command block that replaced the Jukebox so when the Disc falls out of the Jukebox it burns but if you stand near the jukebox it is still possible to get the disc which is something that I don't want.– DesteriousXCommented Jul 20, 2016 at 22:00
-
I'd recommend adding the details of what you've tried to your question.– FrankCommented Jul 20, 2016 at 22:02
-
@Frank I have added details to my question.– DesteriousXCommented Jul 20, 2016 at 22:06
2 Answers
You could run a simple repeating command block killing all item entities in the area of the jukebox, replacing the X Y and Z values with that of the block above the jukebox:
/kill @e[type=Item,x=...,y=...,z=...,r=2]
This could invoke some other problems though, as all items nearby will be destroyed. There are ways around this, such as adding all of the item entities with the ID of music discs to a scoreboard.
/scoreboard objectives add discs dummy
/scoreboard players set @e[type=Item,x=...,y=...,z=...,r=5] disc 1 {Item:{id:"minecraft:record_chirp"}}
Note: this is specific to chirp music discs. To find the id of any other music disc, use F3
+ H
ingame to reveal all items' ids on their tooltips, or use an ID list.
Then killing only the item entities both nearby and that are actually music discs:
/kill @e[type=Item,x=...,y=...,z=...,r=2,score_discs_min=1]
-
I have pasted this into the command block: kill @e[type=Item,x=687.466,y=4.87500,z=-277.843,r=2] but it says [23:48:13] The entity UUID provided is in an invalid format. How can I fix this? Or I entered something wrong? Thank you for your help. Commented Jul 21, 2016 at 3:59
-
Two things. I logged on to Minecraft to actually test this just a minute ago. Firstly, the ID is
record_mellohi
for the mellohi disc andrecord_13
for disc 13. Secondly, the command I tried did work, so it could be the decimal points in the coordinates that are causing the problem, because the following command worked well for me:kill @e[type=Item,x=214,y=56,z=-1280,r=5]
– OliverCommented Jul 21, 2016 at 9:44 -
It works! Like you said, it was the decimal points that were causing the problem. Thank you! Commented Jul 21, 2016 at 15:26
You could change the jukeboxes block data to remove the record:
/blockdata X Y Z {RecordItem:{id:}}
Replace X Y Z
with the coordinates of the jukebox.
This doesn't stop the music currently playing, and will stop it dropping the record item.