Psi icon indicating copy to clipboard operation
Psi copied to clipboard

Trick: Slot Change (Inventory) and Trick: Switch Focus Slot (Hotbar) cannot select the Offhand slot

Open floral-qua-floral opened this issue 2 years ago • 0 comments

Version Information

Forge version: 1.16.5-36.1.0 Psi version: 1.16-95

Further Information

Link to crash log: N/A
Steps to reproduce:

  1. Create a spell that places blocks: {modsRequired:[{modVersion:"1.16-95",modName:"psi"}],spellName:"Testspell",uuidMost:-373019141147834371L,validSpell:1b,spellList:[{data:{key:"psi:constant_number",constantValue:"-2"},x:1,y:2},{data:{params:{_x:0,_y:1,_z:0},key:"psi:operator_vector_construct"},x:1,y:3},{data:{params:{_target:4},key:"psi:operator_entity_position"},x:2,y:2},{data:{params:{_vector3:0,_vector2:3,_vector1:1},key:"psi:operator_vector_sum"},x:2,y:3},{data:{key:"psi:selector_caster"},x:3,y:2},{data:{params:{_direction:0,_position:3},key:"psi:trick_place_block"},x:3,y:3}],uuidLeast:-4936336157101054944L}
  2. Add a "Trick: Slot Change (Inventory)" at the top, pointing into a Number Constant with the value "-106" (the numerical ID of the offhand slot). The spell fails to compile, as Slot Change (Inventory) only accepts positive numbers.
  3. Change the number constant to positive 106 to resolve the error, then place a block in the offhand and use the spell. It will not place a block.
  4. Change the number constant to 36, which is 1 value higher than the final main inventory slot, then attempt to use the spell again. It will not use the offhand, instead wrapping around to using Slot 0.
  5. Replace the "Trick: Slot Change (Inventory)" with a "Trick: Switch Focus Slot (Hotbar)" with the Position input pointing to a Number Constant of value -1 (a guess based off the position of the offhand slot on the HUD). The spell will instead use Slot 9, as it has wrapped around. Using the value 10 (a guess based off the position of the offhand slot on the HUD in left-handed mode) also wraps around to slot 1.

What I expected to happen:
There would be some way of making a spell use the offhand, as it's the most useful and easily changed individual slot in the inventory

What happened instead:
This seems to be impossible; putting the slot ID into the most appropriate spell causes a compilation failure, and other attempts to select it through other means also didn't select the Offhand.

floral-qua-floral avatar Jul 27 '21 21:07 floral-qua-floral