What command can I use to generate a Lingering Potion item with specific radius?



  • Normally with /summon command I can generate a Lingering Potion Cloud Effect that does what I want:

    /summon minecraft:area_effect_cloud ~ ~ ~ {Radius:5,Duration:10000,Effects:[{Id:5,Amplifier:0,Duration:60}]}
    

    But I want a /give command for a lingering potion that does the same thing.

    Is it even possible?



  • According to the https://minecraft.fandom.com/wiki/Lingering_Potion , the only tags on Lingering Potions in item form are:

    • Potion, for setting the lingering potion to one of the default potions
    • CustomPotionEffects, for choosing your own effects, and changing their duration and amplifier
    • CustomPotionColor, for setting the colour of the potion

    The Lingering Potion as an item, unfortunately does not accept any fields to configure properties of the Area Effect Cloud that it produces when it is thrown. In fact, an earlier paragraph on the wiki page reads:

    The cloud starts with a radius of 3 blocks, decreasing to 0 over the course of 30 seconds. During the cloud's existence, any player or mob that walks into it after the first second gets the corresponding status effect; this decreases the radius by a 1/2 block immediately, causing the cloud to disappear quicker.

    For effects with duration, the duration applied by the cloud is 14 that of the corresponding potion. For effects without duration such as healing or harming, the potency of the effect is 1/2 that of the corresponding potion.

    The effect may be applied consecutively if the player or mob remains in the cloud. For example, a player throwing the Lingering Potion of Healing II straight down consumes the cloud within a few seconds while being healed 5 times for a total of 20♥ × 10 health. As far as healing is concerned, this makes the lingering potion much more powerful than the regular or splash potion, provided that the player is away from other mobs or players.

    This paragraph shows that the values are likely hardcoded within the game:

    • Radius, the AEC's current radius, starts at 3.
    • RadiusPerTick is set to -0.005, if my math is correct.
    • RadiusOnUse is set to -0.5.

    Other tags are also probably set to default values too.

    To accomplish a task, you would need to set up a command system that modifies the Area Effect Cloud after it is spawned. Such systems are usually quite complex and it is out of the scope of this question. If you would like more information, feel free to reach out.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2