![]() |
VOOZH | about |
So, seeing as this is one of the only Enchant pages with no explanation of how level mathematically affects the enchantment effect, I decided to do some testing. I tested Loyalty I, II, and III over distances of 5, 10, 15, 20, 25, 30, and 35 blocks. Here are my results for the time between strike and return (partly kept track of via command blocks to ensure accuracy):
| Distance | Loyalty I | Loyalty II | Loyalty III |
|---|---|---|---|
| 5 Blocks | 1.5s | 1.25s | 1.17s |
| 10 Blocks | 2s | 1.5s | 1.33s |
| 15 Blocks | 2.5s | 1.75s | 1.5s |
| 20 Blocks | 3s | 2s | 1.67s |
| 25 Blocks | 4s | 2.5s | 2s |
| 30 Blocks | 3.5s | 2.25s | 1.83s |
| 35 Blocks | 4.5s | 2.75s | 2.17s |
Note that the only anomaly is 25 and 30 blocks, whose results, oddly enough, are swapped in-game (possibly an undetected/unreported bug?).
Observations: over 1 second (which seems to be the base time), return time takes an additional 0.1 seconds per block for Loyalty I, 0.05 seconds per block for Loyalty II, and 0.0333(...) seconds per block for Loyalty III. This works out to a nice, easy formula:
I'm not sure if this is 100% accurate (again, there's that weird glitch around 25~30 blocks I can't explain), but this seems to hold true for all other values tested. After testing Loyalty X at 35 Blocks, the formula seems to still be holding up (measured ~1.3 seconds, the formula gives 1.35).
Thoughts?
--23.124.116.45 16:44, 22 July 2020 (UTC) --23.124.116.45 16:45, 22 July 2020 (UTC) (slight edit because I'm dumb)
/tick command, which didn't exist when the original post was made) and I think the behavior is a little different. First for the game code, it appears to say that after the trident has been in the ground for more than 4 game ticks, the velocity of the trident changes every game tick according to: new velocity = (0.95)×(old velocity) + (0.05)×(level of loyalty). When testing, the sound that the trident makes when returning plays 5 or 6 game ticks after the sound of the trident hitting the block is played. I made an excel sheet to calculate the distances traveled after each tick, and the numbers lined up a lot of the time. I did discover a wrinkle in testing trident return times is that sometimes the trident immediately bounces back towards the player, and sometimes it seems to get a little lost and spins for a little bit before returning. I also did not see a discrepancy for 25 and 30 blocks for Loyalty II when testing. I think the above table and formula might be a good rule-of-thumb for estimating distances, but I don't think I would put it in the article, as it does not appear to be exact. Rampage455 (talk) 03:57, 19 August 2024 (UTC)I had to make a new topic since I couldn't get the table to render in a reply to the previous topic (The maths behind Loyalty's return time). I don't think Loyalty works quite as described in the original comment. If you have access to the game code, and have time to test, please help to verify or refine.
The game code appears to say that after being in ground for more than 4 game ticks, the trident's velocity changes every game tick according to new velocity = (0.95)×(old velocity) + (0.05)×(level of loyalty)
Through the magic of math, I have come up with a couple formulas to compute a trident's velocity and distance traveled for any number of ticks of travel time. These are based on the above equation. I also made a table based on these values to compare to the table in the previous post. In the testing I've done, the trident usually returns within a few ticks of these times. As noted above, there is the odd behavior that the trident sometimes spins around to reorient itself before returning to the player, so there is usually some variation in return times.
velocity at tick n:
total distance traveled at tick n:
Times are measured from the tick that the trident return sound plays, and are listed in: seconds (game ticks)
| Distance (blocks) |
Loyalty I Return Time |
Loyalty II Return Time |
Loyalty III Return Time |
|---|---|---|---|
| 5 | 0.9s (18t) | 0.6s (12t) | 0.5s (10t) |
| 10 | 1.25s (25t) | 0.9s (18t) | 0.75 (15t) |
| 15 | 1.55s (31t) | 1.05s (21t) | 0.85s (17t) |
| 20 | 1.9s (38t) | 1.25s (25t) | 1.0s (20t) |
| 25 | 2.15s (43t) | 1.4s (28t) | 1.1s (22t) |
| 30 | 2.45s (49t) | 1.55s (31t) | 1.25s (25t) |
| 35 | 2.7s (54t) | 1.75s (35t) | 1.35 (27t) |