help me ! How to make sure that the character can sit on a block or other?

Started by alex450 on Tue, 08/20/2019 - 20:31

Topic category: Advanced modding

Last seen on 19:29, 21. Aug 2019
Joined Apr 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
help me ! How to make sure that the character can sit on a block or other?
Tue, 08/20/2019 - 20:31

Good evening! I created this topic for one good reason.
I created a special mod for my friends and me for our own server.
I have created a class chair and would like my character to sit on the chair as in the CrayFish mod "furnitureMod", but I do not know how to make a command in the "procedure" tab?
If anyone finds out how to do it, I will be grateful.

Last seen on 18:02, 22. Sep 2019
Joined Jun 2016
User points:

Statistics:

  • Comments:
  • Forum topics:
  • Modifications:
  • Wiki pages:
I can think of 2 possible…
Sun, 09/08/2019 - 12:48

I can think of 2 possible ways. One is to use commands (in procedures) to summon an invisible boat on the chair. The difficulty is that you could move the boat, which would be an issue.

The other is to teleport the player to the chair when it's right-clicked on and immobilize the player (you could do this with high levels of slowness. Then add a keybind to set a player logic nbt tag to true. Go back to your original procedure and add on the end - if the player logic nbt tag is true, the teleport the player 1 block upwards - on top of the chair, remove slowness from them, and set the nbt tag to false again. The only issue with this method is that the player appears to be standing in the chair - their legs are inside it.