Change hotbar selection

Started by Kemuri Senpai on Sat, 12/12/2020 - 16:46

Topic category: Help with modding (Java Edition)

Last seen on 21:15, 8. Jan 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Change hotbar selection
Sat, 12/12/2020 - 16:46

My idea: if I start to break a block, my hotbar selection should jump to the slot with the "best" item to use. Like axe for a chest or pickaxe for stone

I want to make it client side, so it also works on servers which do not have my mod installed.

If someone has any idea for the code, please tell! I am not good at programming, usually I only use the procedure blocks

Thank you in forward!

Last seen on 21:15, 8. Jan 2021
Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I managed to do it :) If…
Mon, 12/14/2020 - 21:52

I managed to do it :) If somebody needs the code for it - just contact me

Last seen on 17:32, 14. Nov 2021
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I know i'm a bit late, but…
Wed, 11/10/2021 - 17:23

I know i'm a bit late, but can you tell me how? I'm trying to make an autoscroller for random building!

Last seen on 18:44, 17. May 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yeah! Can you share the code…
Wed, 11/10/2021 - 17:29

Yeah! Can you share the code? I want to beat mc in a funny way but I need this

Last seen on 17:32, 14. Nov 2021
Joined Nov 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I think he has abandoned the…
Wed, 11/10/2021 - 19:30

I think he has abandoned the account, last online 10 months ago :(

Last seen on 18:44, 17. May 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
:(
Wed, 11/10/2021 - 19:43

:(

Last seen on 01:08, 28. May 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I know a way to change…
Sun, 01/09/2022 - 00:37

I know a way to change hotbars.

If you need the code. Add me in discord: GrieferHacksYT#0096

Last seen on 18:44, 17. May 2022
Joined Jul 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yeah... And if I don't have…
Sun, 01/09/2022 - 00:40

Yeah... And if I don't have discord?

Last seen on 01:08, 28. May 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
then i just give it here so…
Sun, 01/09/2022 - 00:41

then i just give it here so everyone has it. Didnt think of that.

The code to switch hotbars: "event.getPlayer().getInventory().setHeldItemSlot(4);"

Last seen on 01:08, 28. May 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It switches your hotbar with…
Sun, 01/09/2022 - 00:42

It switches your hotbar with the current item you hold to the hotbar you want

Last seen on 01:08, 28. May 2022
Joined Jan 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
at set.HelitemSlot(4) the 0 …
Sun, 01/09/2022 - 00:43

at set.HelitemSlot(4) the 0 = 1 (0-8)