Magic

Magic

190k Downloads

Rocket spell can be used to clip through walls and floors

Ferocimo opened this issue ยท 19 comments

commented

Hello,

The "Rocket" spell (you mount a rocket and fly a little before exploding) can be used to clip through walls and floors. This is particularly problematic on PvP servers, as players use this spell to enter protected bases.

Could it be possible to make the rocket explode, or the player to be dismounted, as soon as the rocket comes near a block ?

Thank you in advance, we would really need a fix or a workaround for this on our server.

commented

I honestly probably won't get to that anytime soon. If you want to try to do it yourself, feel free, otherwise just disable that spell please.

commented

To be clear, you could try to do it yourself but I suspect the speed of the rocket is going to make it basically impossible to prevent exploits like that. Best to just disable the spell.

commented

Arg, I hopped there would be a way to make the spell detect the proximity of blocks and perform an action based on that, just like you did for the "Horse" spell which allowed players to clip through walls, you created a fix that prevent this spell from being fire when near blocks...

Okay we'll see what we can do on our end then.

commented

You definitely could do that with tick actions and a Sphere + CheckBlock + Cancel, yes

But since the rocket itself and velocity are all vanilla, I honestly don't think you'll be able to guarantee anything, Minecraft physics is pretty crap.

commented

... I mean otherwise you wouldn't have this problem in the first place, lol

But really is this an important spell for your server? I didn't even think it was in a path, it's such a secondary thing IMO, just a goofy and crappier version of fling ... it doesn't seem worth spending much time on, versus just turning it off if it's causing you problems?

commented

We have a heavily modified version of your plugin. I spent over 400 hours modifying, adapting and creating spells derivated from yours, and this one is a new addition that we recently heavily advertised. We could take it back but that would really be a shame considering what we've build around that spell.

We'll rather try to find a fix, even a not perfect one, than removing it.

commented

However even with all that time spent, I'm not very good with creating things from scratch. I really use and modify some bits of another spell to create one.

Would you care to tell me how you would do a "sphere / CheckBlock / Cancel" check in this spell ?

commented

I can surely give it a try myself and see how it goes!

commented

Thanks ! Keep me posted

commented

To be clear- is the problem like with Horse, that they can clip by casting it right near a wall?

Or is it more like once they get to max speed they kind of just shoot straight through walls?

commented

It is neither : it's actually when a player get dismounted near a block, especially near a ceiling, the player clips through it.

So a player that cast the spell inside a room that has a normal ceiling of 1 block, and air above, will pass through the ceiling and get on the outside of the room as soon as he is dismounted.

commented

Theorically if the spell ends and dismounts the player BEFORE it hits the ceiling, the player should not be able to clip through it.

commented

Ok, thanks

I think the main problem here is going to be how to detect that ceiling without it just straight cancelling the spell on cast ... guess need to ignore the ground and only look up?

commented

I thought of that issue too when I suggested that fix. Two main possibilities in my opinion :

1- Make the check sphere center be located one block ABOVE the head of the player. So the check would only detect when a block is above the player, and not make a "false positive" when the player is on ground.

2- Make a very short delay (configurable), during which the "check and cancel" would not be applied. So when you would cast the spell, it would not try to detect block proximity at the very begining, for 0.5 second for instance, and then the "checking" would start. So the ground will be ignored.

commented

Trying to reproduce this now- is the more to it than casting while under a ceiling? Do you have to mash shift at the exact right moment or something?

commented

Easiest way to reproduce :

http://www.noelshack.com/2020-27-4-1593643174-2020-07-02-00-39-03.jpg

In that configuration, the player standing on blue block and aiming straight forward at red block will go through the big wall in front of him.

This is because he is dismounted while inside the angle between the wall and ceiling.

commented

Ok, I think i got it... but it did turn out to be a lot more complex than I'd hoped. I had to add a few new features in code, so you will need the latest dev build.

http://jenkins.elmakers.com/job/MagicPlugin/3090/

Here is what I was using for testing, I have updated the builtin rocket spell to be this, minus the "Message" part- but I thought you might like to have that for testing, it'll show you when the new logic kicks in and ends the spell early.

rocket:
    icon: spell_icon:191
    icon_disabled: spell_icon_disabled:191
    icon_url: http://textures.minecraft.net/texture/5a532e9d2221b1a2ffdbc701578331c8da41c36d1487696fefa584373572
    category: utility
    worth: 100
    earns_sp: 2
    actions:
        cast:
        - class: FallProtection
        - class: Parallel
          actions:
          - class: Firework
            start:
            - class: Mount
            actions:
            - class: Stop
          - class: Repeat
            repeat: infinite
            actions:
            - class: Delay
            - class: Retarget
            - class: Volume
              center_y: false
              x_size: 1
              z_size: 1
              y_size: 1
              actions:
                - class: CheckBlock
                  allowed: "!passthrough"
                  actions:
                    - class: Message
                      message: BOOM
                    - class: Mount
                      dismount: true
                    - class: Stop
    effects:
        cast:
        -  sound: entity_firework_launch
           sound_pitch: 0.1
           sound_volume: 1.2
        -  sound: entity_generic_explode
           sound_pitch: 0.4
           sound_volume: 0.8
           location: origin
           particle: explosion_large
           particle_count: 50
           particle_offset_x: 3
           particle_offset_y: 3
           particle_offset_z: 3
    parameters:
        target: self
        launch: true
        cooldown: 15000
        power: 0
        speed: 0.05
        expected_lifespan: 30
        set_target: true
        duration: 20000
    costs:
        mana: 75
commented

If you're curious, the new features were:

  • "dismount" option to Mount action
  • "start" actions for projectiles .. I had a really hard time getting the player to mount the firework, but also tracking the firework until it explodes (to end the spell) while simultaneously repeating block checks to early-end the spell. The "start" actions were my compromise.
commented

Sorry for the delay, I was away for a few days. Thank you for the fix, it works as intended ; of course it also often prevents the spell from working fully when casting it near a wall, but that's a deal I can work with.

Anyway thank you again for your time !