#Hello! How may i change the offhand of a player to what the player is holding?
1 messages · Page 1 of 1 (latest)
So i will check what the player is holding if its totem then it will go to offhand when i rightclick
daa
do
player.getComponent("equippable").getEquipment(EquipmentSlot.Mainhand)
tysm
np
I also have an easier method
are you using typescript or javascript?
so I know which file to send you
so you can just do player.heldItem instead of all of that
@strange swift
JS
k
I'ma send you a JS file that you can import to add some useful methods to the Entity prototype, but if you want me to send it you have to credit me, since I spent quite a while making it.
I'll send it in a few hours, when I get the chance.
it is from one of my add-ons
Are you using VSCode?
If so, I can also send you the .d.ts file for the autocomplete to detect the custom accessors and methods.
yes
i'd be very happy if i had autocomplete
also it won't be public
oh ok
lol, I just realized I answered like 17 posts in the last hour
Oh btw I would highly recommend switching to typescript, you will get MUCH better autocomplete and error detection if you use it.
If you need, I can help you switch your JavaScript code to TypeScript, I have helped many people with that before.