ZHorse

ZHorse

10.4k Downloads

Horse with speed 200% or more

Sollembum78 opened this issue · 14 comments

commented

Bug report

What are you trying to do ?

Buff horse with potion effect of speed and then send to stable.

What is the expected behavior ?

Speed of stored horse shoud remain unchanged after potion effects applied to it.

What is the actual behavior ?

Sometimes player buff their horse with speed potion and then send it to stable, horse can keep this speed even after potion effect is off. Horse is saved with this new parameter.

How to reproduce the bug ?

  1. Buff horse with potion of speed
  2. Send horse to stable (I believe stable should be in unloaded chunks for this bug to work)
  3. Later if you summon horse and from that point it will remain with speeds like 240%, even after death and ressurection.

Console output

Occasionaly console gives this error. I'm not sure why it is, and if it's connected to bug or not. I'd use mysql, but my hosting provides me with older mysql server then supported.
https://pastebin.com/yMaiwkvh

Environment specifications

  • Operating system :
    xubuntu 14.04
  • Java version :
    8
  • Server version :
    git-Spigot-93e20b3-b8f84f3 MC 1.12.2
  • ZHorse version :
    1.6.8
  • Database :
    SQLite (as my version of MySQL is older then supported)
commented

The /zh stable go command simply send the horse to a location and doesn't store it. So if there is an issue, it would rather be related to unloaded chunks that make ZHorse register horse stats in the database.
So, I tried to replicate your issue but I couldn't see any difference of speed by simply throwing a splash potion of swiftness (+20% for 8m) at a standard horse in the first place. Hence, I did not observe anything strange when unloading and loading the horse back.
Could you describe exactly what is expected to happen when I throw such a potion at a horse, and also tell me if this is the right procedure to do to replicate the issue ?

commented

This pic shows the problem. We have translated the plugin, but line "Скорость" stands for speed, and as you can see it's 237%. I wonder how is it possible.
https://pp.userapi.com/c840237/v840237233/4bb64/6SzJZQuvZZs.jpg
It happens not every time, out of 50 players this happend only to 4-5 of them, but I got reports of horses being incredibly fast, and I checked this horses, got some screenshots of /zh info with speed parameter. I can also record some videos of super fast horses, but I'm still not sure how exactly I can reproduce this problem, seems like it happens at random.

Horses move 2-3 times faster than any regular horse can move even with speed potion effect. I asked players how did this happen, and they told that it happens sometimes if you throw potion of speed and than send horse to stable. There are several horses like this in database (I can send .DB file to you, if this helps).

I expect that player throws potion of speed and horse gets temporary boost of movement speed, and then effect wears off and horse is back to normal speed. And I don't think horses stored to DB should have speed more than 100%. Also, there are no custom summoned horses or spawner eggs with modified nbt info, all horses on our server are from natural spawning.

I attach our DB file, and example of horse with speed higher than normal is named "Аномалия"
zhorse_db.zip

commented

Could you use /zh info on a normal horse and then on a horse with speed bonus ? Tell me if the value for the speed changes. Also, you could do /zh settings stats exact and do it again.

commented

Well the "issue" here is that ZHorse allows crazy speeds or jump strengths to be recorded into the db, because this is a feature available through the /zh spawn command.
I will try again tomorrow to make the bug happen but in any case (whether it happens or not) I will have to play with active potion effects of the horse when it is unloaded. I cannot think of a case where it would be bad to clear all potion effects before unloading the horse, so I guess that I will go for that solution.
However, I'm a bit concerned about the fact that I do not see any difference of speed (even with /zh info) when I throw a potion at a horse, regardless of whether the wrong stat is recorded in the db.

commented

Yes, I think clearing potion effects should fix this. According to my players, speed potion is the source of this issue. But even if it's not, horses were spawned with normal speeds, that vanilla minecraft allows, and later somehow were stored with speeds higher then 100%. There is no way horses could spawn with such speeds, so something has changed after they were claimed, and potions are what my players use often when they riding.

Can't imagine anything else that could affect this. Other then some pressure plate pushing things... They are made with Skript and they can push entities via default Skript effect (which, I believe, adds velocity to entity to push it in direction of vector).

commented

Do you have some script that changes the horse speed stat ? I buffed my horse will all possible potions and the speed stat never changed.
If the speed buff is merged with the speed stat, I doubt that clearing potion effects will sort that out.

commented

There are no scripts that modify movement speed. There is script that reduces damage taken by horse. And also there is script that allows mobs to be pushed, but it's like 1 second push in defined direction, with no lasting or permanent effects.

commented

@Zedd7
Okay, so one of our players figured it out. To reproduce problem you have to do following:

  • sit on horse and claim it
  • unmount
  • buff it with splash potion of speed
  • mount and type /zh info
  • unmount
  • mount, /zh info, unmount, mount /zh info and repeat
    Speed will increase each time you check it with this command while potion effect is active.
commented

It turns out that the bug is caused by the ArmorWeight plugin.
A new entry has been added to the Tips and Tricks page on ZHorse's wiki : https://github.com/Zedd7/ZHorse/wiki/Tips-&-tricks#fluctuating-horse-speed-swiftness-potion-bug-exploit

commented

Just want to add, that this must be conflict between plugins (ZHorse and ArmorWeight), because without either of them bug is no longer present.

And to fix this, currently user simply have to turn false these values in config of ArmorWeight:
weightEnabled.armor.horse
weightEnabled.horseRider
effectEnabled.speed.horse

commented

I just did exactly that on a fresh new server and database and could not reproduce the bug.
Could you show it to me on your server ? If so, you'd have to clear my password (name = Z3dd7) because I logged in a few weeks ago and can't tell what pass I used..

commented

Okay, your new password is: 23256865268
When you join, choose Survival Pro, you will appear in house with horse spawn eggs, potions, saddles armor etc. Also there will be two sings, clicking one of them will give you zh.* permission, another one will remove it, just in case you need admin rights for the plugin. I've made backup of database.

Just to remind, ip of server is play.zion-craft.ru and version is 1.12.2

commented

Ok I'm in and could reproduce the bug. This is strange because I followed the exact same steps on my server with very close environment. I guess that some other plugin is in fault but I can't be sure for now.

Could you now update ZHorse with the attached file so I can work on my current branch ? That would be easier for me.

I am logged now and can log in tomorrow if you are available for extensive testing.

ZHorse 1.6.9 snapshot 2.jar.zip