Take the 2-minute tour ×
Arqade is a question and answer site for passionate videogamers on all platforms. It's 100% free, no registration required.

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?

share|improve this question
    
You could put them in dispensers at random checkpoints. –  Jeffrey Lin Feb 28 '13 at 1:40
    
This is for an arena, and I need an unlimited amount because it will take a very long time for the player to win. –  Shadow Zorgon Feb 28 '13 at 1:43
    
A Potion of Night Vision lasts for six minutes. –  Jeffrey Lin Feb 28 '13 at 1:44
    
And? The mini game is designed for a group. It requires 64 Golden Apples, which cost 64 gold each, which require 64 gold collected, which a gold is 1 mob drop. –  Shadow Zorgon Feb 28 '13 at 1:46
add comment

2 Answers

up vote 1 down vote accepted

The data value for potions is 373 and the "damage value" for an extended Night Vision potion is 8262, and you want to give quantity 1. Using these in a command block hooked up to your button, with @p used to select the nearest player, looks like so:

/give @p 373 1 8262

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.

share|improve this answer
add comment

You can do /effect @p 16 (which is night vision) 999999 (which is forever) 255 (amplifier) you don't have to put in the parenthesis.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.