I'm creating a new cantrip to be used that would allow several targets to be hit in a line, with diminishing damage (half the damage of the target hit before it), and my initial idea was to word it the same way as Green Flame Blade and call it a melee attack. But I thought that could become unbalanced if a paladin ever got ahold of it, so I then wanted to call it a ranged attack. But that got confusing on how to word it because of the weapon required (a weapon that deals slashing damage), so I'm stuck on what to call it. If I can just call it an attack without having to specify which one it is, that would be great, but I don't know if that concept exists in 5e. So I'd like to know any examples of such attacks, if they exist.
5th Edition D&D only recognizes Melee and Ranged attacks, irrespective of whether it is a Weapon attack or not
In the Player's Handbook, under the section Making an Attack (pg. 193—), there's subheadings for Melee Attacks and Ranged Attacks, and no further distinction is made. That doesn't necessarily preclude you, as DM, from adjudicating further types of attacks, but given how many rules directly and explicitly interact with the rules for these two types of attacks, I don't think it's advisable to create a third category of attack.
Granted, the line between these types of attacks is not always clear-cut. For example, the spell spiritual weapon allows the spellcaster to make a "melee spell attack" against a creature that's quite a substantial distance away from the spellcaster. That might seem unintuitive, but the mechanical consequences are very clear:
- A spellcaster making an attack using spiritual weapon isn't subject to the Disadvantage that would be conferred upon their attack roll if a hostile creature were within 5 feet of them; in contrast to how ranged attacks normally behave.
- The creature being targeted by the attack has to be within the 5 foot range of the physical location of the spiritual weapon at the time the attack is being made, as though the spellcaster them self were at that location
So it's pretty reasonable for the spell you're trying to create to simply use a Melee Spell Attack (or a Melee Weapon Attack, if it's triggered identically to Green-Flame Blade or Booming Blade) to decide its success or failure.
You needn't worry about Paladins
Unable to see the exact wording you've proposed for your new spell, I'm going to speculate that the wording probably reads something like this:
You brandish the weapon used in the spell's casting and make a melee attack with it against one creature within 5 feet of you. On a hit, the target suffers the weapon attack's normal effects, and you can cause a bolt of lightning to erupt from the target, striking creatures in a 15' long, 5' wide line beyond them. The nearest creature takes 1d6 Lightning damage, and each creature beyond takes half the damage of the creature immediately before it.
This spell's damage increases when you reach certain levels. At 5th level, the melee attack deals an extra 1d6 lightning damage to the target on a hit, and the lightning damage of the lighting bolt increases by an additional 1d6, to 2d6. Both damage rolls increase by 1d6 at 11th level (2d6 and 3d6) and 17th level (3d6 and 4d6).
—My suggested wording for your cantrip
So just to start with, it's clear that a paladin's ability to add Divine Smite damage to their damage rolls would not have any notable knock-on effects on the other targets of the spell. They would be able to do a very high amount of damage on a critical hit, but that's also true of spells like Green-Flame Blade and Booming Blade, which are perfectly acceptable in the current game.
Now, it's possible you've worded your cantrip that it will instead base the damage of the line AOE effect on the total damage that the first creature took, which would cause a Paladin's smites to scale very powerfully, and in that context, my suggestion is to instead consider the wording I've chosen. It's clean (and nearly identical to how spells like Green-Flame Blade and Booming Blade are written) and difficult to exploit.
And if you'd rather stick to your version, I honestly wouldn't worry about it so much. It's sometimes okay to let players discover powerful combos, and if a paladin's ability to propagate smite damage to extra creatures in a line is so game-breaking as to break the balance of a campaign, I think that speaks to broader, more systemic problems with how the encounters are designed in that campaign, or in how the DM is building stakes.
Use a spell attack.
It’s a cantrip, which is a spell. If you’re worried about it stacking with features that use weapon attacks, make it a spell attack. Since it’s a spell.
For the actual feature, use a line area of effect:
A line extends from its point of origin in a straight path up to its length and covers an area defined by its width.
Just make it a line area of effect however long it needs to be and word your spell description so that each creature in the line takes the appropriate damage.
So your spell description could look something like:
Range: Self (5 ft)
Make a melee spell attack against a creature within 5 feet of you. On a hit, a five foot wide and 20 foot long line of flavorful magic energy emanates from you in the direction of the creature you hit. The creature you hit takes 1d8 flavor damage. If there are other creatures in the line, the second takes half the damage taken by the first, the third takes a quarter, and so on.
Or something like that. Consider how you want the extra damage feature to interact with critical hits.