Traveler's Backpack

Traveler's Backpack

26M Downloads

Allow hose to "throw" potions as splash potions

AndrewGraber opened this issue ยท 2 comments

commented

Is your feature request related to a problem? Please describe.
I really like the idea of being able to put potions in the backpack tanks and drink them as needed, but I think it'd be cool if they could also be used as splash potions.

Describe the solution you'd like
I think the best way to handle this would be that when the hose is in "spill" mode, and the active tank has a potion, using the hose would throw a splash potion version of whatever is in the tank. You could even make it require a gunpowder out of the backpack's inventory for every 3 thrown or something.

Describe alternatives you've considered
N/A - you could just put splash potions in the backpack I guess, but you'd have to manually pull them out, and going into inventory during a fight is never a good idea.

commented

You can use hose drink mode, and drink it directly from the backpack

commented

I believe what this person is asking is for, is the ability to use the Spill mode to give a potion effect that is stored in the selected backpack tank to a mob that is not themselves. This would be a NEW feature. It would likely be something that can be enabled or disabled in configs.

Example functionality:

Place an instant damage potion into the "tank fill" slot.
When the "hose" is in "Spill" mode it can draw from the backpack tank to spray the potion at a mob.
By either, Summoning a splash potion with the potions values from the backpack tank with forward velocity in the players look direction.
Or, making flame thrower like functionality which would create particle effects with the potions color value which would "spray" out over the area the player is looking in and would give the effect to the mob that it hits.

When making a flame thrower like effect it is important to create intervals that the player can be effected at so that the player doesn't get dealt a "instant damage" potion effect so fast that they instantly die.
Say I have 1,000 MilliBuckets of Instant damage aka 3 bottles (999 mB) or 1 bucket (1,000 mB) I would only want to be dealt instant damage 1 time for every 333 mB (1 bottle) of instant damage potion. But for the sake control and to make the effect of a flame thrower the spray would last about 2-4 seconds per bottle (sprayDuration) > or until stopped spraying. So if we were to make a entity that is spawned from spraying a potion from a hose that copied the players ID tag and gave it to hit targets as sprayedPotionBy:{id:"playerId"} They would get the potion effect from the entity that gave them the sprayedPotionBy but not be effected by an new "spray entities" of that players ID unless the option effect time is >0
The 'sprayedPotionBy' attribute would be removed after the life span of the "spray entities" is over not any time sooner.

Any potion with a 0>effect time should make a single spray instead of a continuous one for balancing purposes.

The duration of the effect applied to the player should be proportional to how much of the potion they were sprayed with. If it was 1 full bottle then give them the full duration. This does not apply to single spray potions (Ones without Duration) as a full bottle would be consumed each spray.
This would allow the entity to get effected by fire resistance over and over adding to the timer each time they are hit by the "effect entity's"
Also make sure that each spray entity is removed after giving its effect and that it is modular to include most modded effects. May also include configs for every new effect (including generic mincraft effect) to ensure that you can change how something works in cases that a potion does not work as intended

This should cover most of the basics to how a feature such as this would work from my point of view.