2020.4 How to make a rideable entity fly by pressing on a key

Started by MonochromEND on Tue, 08/11/2020 - 01:21

Topic category: Help with modding (Java Edition)

Last seen on 08:54, 24. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
2020.4 How to make a rideable entity fly by pressing on a key
Tue, 08/11/2020 - 01:21

Hi everyone it's my first mod and i want to create airships that you can control like a boat but with a twist that i can't seem to apply to a rideable entity ^^'

(P.S : sry for english mistakes i'm french)

 

SO on what i was able to do :

With the code below, i can make the player move like i want, which is going up and down, and rotate the view left and rigth (mouse does not work to rotate which is intended) with the arrow keys.

 https://drive.google.com/file/d/1cSskjDeAor2vYwKXSnFLKjpSPn6IMf66/view?…

For the airship i tried to place it in the trigger OnTickUpdate with a condition if the entity is beeing is ridden and it didn't worked.

I also tried some other mishaps, but nothing worked.

But i identified maybe a way to resolve the problem but i'm still not experienced enough in C and Forge to make it.

https://drive.google.com/file/d/1Ba3aEB1D0lxqNILzpK9OY833oaMvyvSB/view?…

If i could modify the Y coordinate of the Vec3D with my global variables VERTICAL and HORIZONTAL (see in the last code). I'm pretty sure it would work.

 

Now if someone can help me on this problem it would be really kind of him :)

Have a nice day envening or whatever and keep it up with every thing you are working on :D

 

Last seen on 14:43, 24. Sep 2020
Joined Jan 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
I don't think you can,…
Thu, 08/13/2020 - 13:45

I don't think you can, unfortunatly. This is a heavily requested feature, though.

Last seen on 08:54, 24. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Mmmmmh ... kind of lame but…
Thu, 08/13/2020 - 22:20

Mmmmmh ... kind of lame but i was kind of waiting this reply.

Guess we will not be able to wistand the majesty of airships till a new update but thank you for the reply :)

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i did not understood what…
Sat, 08/15/2020 - 00:32

i did not understood what you want to do, i did a helicopter these days, it fly nice, spend fuel when flying and make sound when flying, i want to help but im not sure what you want, you want to make it go up/down (Y axis) with a Key instead of head Pitch?

Last seen on 23:08, 24. Sep 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
  I did it but half, with…
Sat, 08/15/2020 - 04:15

 

I did it but half, with potions

 

Last seen on 23:08, 24. Sep 2020
Joined Sep 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
  a mob that always has slow…
Sat, 08/15/2020 - 04:16

 

a mob that always has slow falling and a key binding that levitates it for 5 seconds

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
why not make the key binding…
Sat, 08/15/2020 - 04:55

why not make the key binding move on Y axis instead of levitation?

Last seen on 08:54, 24. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Oh i'm really interested on…
Sat, 08/15/2020 - 10:01

Oh i'm really interested on how you made it :o

I don't know what you mean by using head pitch but if it works for you then i'd be really glad if you could show me :)

For the movements i just want my airship to go up and down on the Y axis by pressing up and down arrow.

Also, but it's more for realism it would be awesome if i could limit the speed of rotation around the Y axis.

Ty for the support guys i really wait your responses :D

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
head pitch movement means…
Mon, 08/17/2020 - 01:37

head pitch movement means the helicopter move up/down using the regular x/z speed and keys (w,s,a,d) but it goes up and down when you aim your mouse aim at it (like if you point the mouse above the screen horizon it will go up, i find this control much much better to fly a helicopter than arrows, for a plane thou, the keys would be nice to control the Y axis more realistic, the thing you said 'airship' here, does it fly like a helicopter or a plane? i can share my heli procedures with you if you need those, if you need the plane style we will have to cook something using key bindings. let me know! ;)

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
the Mcreator guys posted…
Mon, 08/17/2020 - 01:39

the Mcreator guys posted something like this sometime ago, i changed a bit for my heli, but all you need is here:

(you dont actually need that 'Print' part btw):

as

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
this is a player tick…
Mon, 08/17/2020 - 01:43

this is a player tick procedure, from it, you can add logic movements for all your veichles, i got on mine now for the helicopter, rocket and motorcycle, just put another IF/Do under that for each ship.

 

also using NBTs for entities i was able to make a procedure to create sound (when flying only) and consuming fuel (cell with fuel; item on Entity/veichle GUI), i can share those too

 

sorry my english btw im from Brazil

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
i did not make a airplane…
Mon, 08/17/2020 - 01:45

i did not make a airplane yet, but im planning to, imagine i would replace the head pitch thing there with some key binding, i just dont know how i will put 2 key bindings for VY vector (like UP and DOWN arrows), let me know if you think of something too ;D

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
there is also some 'fix…
Mon, 08/17/2020 - 01:50

there is also some 'fix/tricks' you need to do in order to use entities as ships and cars by editing the code; you dont want your helicopter wondering around like it is alive lol, so you need to disable its 'random walking' goal on the code, i dont think you cant just not use IA cause i tried and my heli would not fly anymore.

Last seen on 08:37, 31. Aug 2020
Joined Sep 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Just made a functional Gas…
Mon, 08/17/2020 - 05:30

Just made a functional Gas Pump here for a gas station: it auto fills my bike with gasoline :D

Last seen on 08:54, 24. Sep 2020
Joined Aug 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
ITS WORKING TY SO MUCH !!!!!…
Mon, 08/17/2020 - 08:42

ITS WORKING TY SO MUCH !!!!!!

I'll be sure to credit you if i release this mod :)

Also i'm quite interested in your procedures for the gas station and the fuel consumption if you don't mind of course ^^'

Stay tuned for a release date :D