How do I spawn potions with Command Blocks?
I want to get super speed, like a speed III for 1:00? I want it to be a splash potion that spawns from a command block, I know it can be done, since potions are entities.
Solution 1:
You have to use the command /summon
.
Summons an entity (mobs, projectiles, items, vehicles, etc.).
The entity for the Potion is called "ThrownPotion". If you want a special effect to that Potion you have to use a variable where you are able to configure the effect.
The whole command looks like this
/summon ThrownPotion ~ ~ ~ {Potion:{id:373,Damage:8226,Count:1}}
The ~
indicates the relative coordination to the commandblock (you can change it to the coordinations where you want to spawn the Potion otherwise the Potion is spawing in the commandblock).
The variable Damage
is the effect it will have and count is the count
of how many Potions will be spawned.
A list of the effects you find on the wiki.
Solution 2:
A more simple approach (and a more reliable approach) would be to use the /effect
command directly. This directly gives the player a status effect as specified. The syntax is as follows:
/effect <player> <effect> [seconds] [amplifier] [hideParticles]
Where <effect>
is the status effect id (e.g. 1
, or minecraft:speed
). So, for example, if you wanted Speed 3 for 60 seconds, the command is as follows:
/effect @p minecraft:speed 60 2
Note that amplifier is zero-indexed, that is to say that 0 corresponds to effect level 1.