marcelo-mason / PreciousStones

Self-service protection for Minecraft servers
http://dev.bukkit.org/server-mods/preciousstones/
56 stars 66 forks source link

Suggestions: Levitation effect and Target Mobs #1063

Closed Omanoctoa closed 7 years ago

Omanoctoa commented 7 years ago

Hello! I've really wanted to add a fun field using a Levitation potion effect, but I don't think it is available yet (unless it's just not listed on the wiki). Could you add the Levitation effect to the potion list? I'm curious if it would be possible to add the Luck effect (harder to control, but could be useful) as well.

My other suggestions is the ability to target mobs within a field as well. For instance, a field with a target-mobs: [Zombie, Zombie Pigman, Endermite] tag would apply effects (even if just some effects, like potions) to any Zombies, Pigmen and Endermites within the field radius. Ideally, a second flag for Ignore-Players: true/false would be useful too, to only apply effects to mobs, rather than players. Again, this would only be possible for certain flags (namely potions), but could wildly advance field usage potential.

Coldene commented 7 years ago

You can get pstones to run commands as player or console on enter/exit the field.

So make it do something like ...anything? This command will cause all vanished holograms from Slimefun energy/cargo blocks to suddenly re appear and a fake armor stand character with a skull head on fire floats to heaven finally vanishing and dropping a SF motor. It would instatly refresh and re enabling the nearby holograms in a humorous but facepalmable way, soon as anyone/owner enters the field. This also applies levitation to specific targets as you mentioned above? You can use Glowing:1 or the potion effect's id.

player-command-on-enter: 'entitydata @e[type={player},r=3] {ActiveEffects:[{Ambient:0,ShowParticles:1,Duration:100,Id:25,Amplifier:17}],Invisible:0,Fire:100,Small:1b,CustomName:"§f§lRiP Mr Stand",CustomNameVisible:1b,ShowArms:1,NoBasePlate:1b,OnGround:0,NoGravity:0,Glowing:1,ArmorItems:[{},{},{},{id:"397",Damage:3,Count:1,tag:{display:{Name:"§cElectric Motor"}}}]}'

Any player that enters the field is instantly visible at range even through walls? Experiment with the various player placeholders in the above example PreciousStones {player} placeholder is used, it might not work but should :D If not try @p ect. player-command-on-enter: 'entitydata @e[type={player},r=3] {ActiveEffects:[{Ambient:0,ShowParticles:1,Duration:2000,Id:24,Amplifier:1}]

Or something like... "Entering Gravity based self harvesting skydiving meteor sheep farm... " player-command-on-enter: 'entitydata @e[type=sheep,r=16] {ActiveEffects:[{Ambient:0,ShowParticles:1,Duration:100,Id:25,Amplifier:17,Fire:100}]}'

Lore based entry/exit messages as well as Field title welcome/farewell messages? player-command-on-exit: 'msg {player} §6The hum of an §bEnergy Grid§6 static field fades into the distance as you leave the area...' player-command-on-enter: 'msg {player} §6The hum of an §bEnergy Grid§6 static field grows louder as you approach the area...'

WARN. Players would just move 1 block in and out of the field repeatedly to spam the above armor stand effect for free motors :D so think about what you get them to do. Editing even 1 NBT tag with a entitydata @e[ ] type command will cause all possible NBT tags and settings for that entity to be shown in console and in game.. think about that also. It does work though.

Omanoctoa commented 7 years ago

This is true, the command-on-entry/exit and player-command-on-entry/exit flags are super-useful here, but they have some quirks:

-Like you mentioned, players could simply walk in/out of the field repeatedly, spamming the command/effect. I've thought of a way around this however, at least in terms of commands: Another plugin called SimpleAlias can be used to bundle commands together into a custom alias, complete with permissions, cool-downs, warmups, usage price and much more. Make a PS field run an alias with a cool-down when players enter the field and voila, problem solved.

-Some commands must be run by a player using SUDO and not by console, and like you mentioned with the /entitydata command, it often results in that player being spammed by vanilla MC command output (ugh).

-Players entering/exiting the field would have the Levitation effect applied for a certain amount of time (or indefinitely) even if they leave the field. I'm simply looking for the potions flag to be updated to include the Levitation effect (if it hasn't already, since this is an old thread). The other reason why using the command-on-entry to apply effects is a bad idea, is because if the player remains in the field until the effect wears off, they would need to exit and re-enter the field to re-apply the effect.

marcelo-mason commented 7 years ago

Updated the wiki, all effects are available.

Added "potion-targets" and "potion-ignore-player" flags.

Omanoctoa commented 7 years ago

Oh awesome! Brilliant work!

I do believe you have one error in the Wiki however. The Wiki says to use [single-line, list, format] for listing multiple Potion effects and Potion Intensities, but doing it that way causes the field to be ignored when loaded. From my experience using multiple Potions, you have to use this syntax:

  potions:
  - POISON
  - HUNGER
  potion-intensity:
  - 1
  - 2