[TUTORIAL] add Binoculars/Telescope in 1.18117

Started by TiberiumTree on Fri, 06/11/2021 - 19:36

Topic category: User side tutorials

Last seen on 20:29, 19. Jul 2021
Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
[TUTORIAL] add Binoculars/Telescope in 1.18117
Fri, 06/11/2021 - 19:39 (edited)

 

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.

 

 

 

Edited by TiberiumTree on Fri, 06/11/2021 - 19:39