TransWikia.com

How do I spawn potions with Command Blocks?

Arqade Asked by MuffinWalrus on August 17, 2021

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.

6 Answers

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.

Answered by Gerret on August 17, 2021

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.

Answered by Unionhawk on August 17, 2021

If you are wanting the potion in your inventory rather than in effect, you will need to use droppers. Unfortunately they haven't made a way for a command block to do the job. Droppers should work well for a while. But this also means you must refill them often.

(I am using potions for a PvP map. If there is a different reason you want a potion-giving command, I probably don't have an answer, other then using your creative inventory or the answers above.)

Answered by Deathflame280 on August 17, 2021

/give @p minecraft:potion 1 18197
The 1897 is the code for splash potion of healing add a 1 in front for splash.

Answered by user114819 on August 17, 2021

/summon Item ~ ~1 ~ {Item:{id:373,Damage:16385,Count:1,tag:{CustomPotionEffects:[{Id:1,Amplifier:1,Duration:1000000,}],display:{Name:"Name of Item",Lore:["Line 1 of Lore","Line 2 of Lore"]}}}}

That command should summon a dropped potion.

Answered by 316thebrains on August 17, 2021

/give @p slash_potion (amount) (id 1-40)

Answered by hellforge on August 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP