I am trying to create a mob arena (dark) so that I can finish a mini game map. I want to put a button that will give the nearest player an extended Potion of Night Vision. What would be the code to spawn that in?
Minecraft spawning in potions
minecraft-java-edition
Best Answer
The data value for potions is
373
and the "damage value" for an extended Night Vision potion is8262
, and you want to give quantity1
. Using these in a command block hooked up to your button, with@p
used to select the nearest player, looks like so:Assuming you want this button to work only once, you can put an RS NOR latch between the button and the command block, so that the button activates the SET input (optionally with a hidden button accessible only to you attached to the RESET input, for easy testing).
You may also want to use the
/say
command to alert the player that they just got the potion, since in the heat of the moment it's easy to overlook something quietly popping into your inventory, if your not expecting it. They'll still have to ready and drink it.