Topic category: User side tutorials
1.create a potion
When potion applied: execute command / in the name of Event/target entity
attribute @s minecraft:generic.movement_speed modifier add 3d952521-d8be-4e6d-9906-d1fb22ca3156 vps_binoculars -1 add
When potion expires: execute command / in the name of Event/target entity
attribute @s minecraft:generic.movement_speed modifier remove 3d952521-d8be-4e6d-9906-d1fb22ca3156
2.create an item/tool
When right clicked in air: add potion with level for 5 ticks ambient false particles false to Event/target entity type CUSTOM:BinocularsFakeEffect.
Higher ticks results in a slower reaction after release the right click, lower ticks results in zooming in and out repeatedly.
3.create an overlay
Draw a circle with an eraser on a black background and use this as an overlay image.
Display overlay in-game: Get remaining ticks of Event/target entity potion: CUSTOM:BinocularsFakeEffect ＞ 0
Better Procedures plugin seemed not to work on Version:2021.1.18117, and neither the Trigger: On player stopped using, so there I chose a pretty classical way.
It does not really zoom in much, and the player cannot move when using; a sort of alternative to real binoculars.
UUIDs here are not fixed, you can use random UUIDs in step 1, but make sure the UUID added and removed are the same.