I need help with swing procedure

Started by Grinp on

Topic category: Help with modding (Java Edition)

Last seen on 21:37, 28. Jan 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I need help with swing procedure
Mon, 01/29/2024 - 18:21 (edited)

Im trying to make an item that is given to a player when they swim 5000 blocks, and when they right click it, it gives them perma dolphins grace and conduit power. and no other player can get it once 1 player has, but also, when they right click it, it goes to a special slot. how do i make the extra slot(which should only be able to hold the custom item) and the item itself

Edited by Grinp on Mon, 01/29/2024 - 18:21
Last seen on 15:22, 25. Feb 2024
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
have a global world variable…
Sun, 01/28/2024 - 20:30

have a global world variable that is false, when the player right clicks this item it checks if the variable is false and gives the effects, and makes the global variable true, as for the swim 5k blocks, that is not something I'm aware of how to do. the slot one you might not need, unless you want the player to be able to take it off, there you could just use a gui with inventory, 1 input slot and have it save to the player so it saves items there, and just make a keybind to open it.

Last seen on 21:37, 28. Jan 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
could you please show an…
Sun, 01/28/2024 - 20:55

could you please show an image?

Last seen on 19:53, 25. Feb 2024
Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It appears that we can only…
Sun, 01/28/2024 - 22:31

It appears that we can only insert images via URLs. 

Last seen on 21:56, 18. Feb 2024
Joined Nov 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
To use a swimming variable,…
Sun, 01/28/2024 - 22:49

To use a swimming variable, check if the player's current position is in water every tick, then if so, use the Pythagorean theorem on the x and z delta player data to find the total distance travelled in that tick (excluding vertical motion) and set the variable to its previous value plus the calculation.

Hopefully, someone can explain this in less technical terms.