How to force player doing something?

Started by QB on

Topic category: Help with modding (Java Edition)

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to force player doing something?

So I wanted to force players to jump if they have something in their inventory, is that possible so far?

Last seen on 13:41, 3. Dec 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't think so, the "if…
Sat, 03/21/2020 - 14:40

I don't think so, the "if they have something in their inventory" part is possible (obviously) but the force to jump part really isn't. the closest thing I can think of is temporarily putting a slime block under the players feet, a piston under the slime block then activating the piston, then removing all of that when finished.

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ah, thank for the reply, I…
Sat, 03/21/2020 - 14:50

Ah, thank for the reply, I'll scrap the idea.

Last seen on 13:41, 3. Dec 2020
Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
ur welcome :3 anyway, it's…
Sat, 03/21/2020 - 22:07

ur welcome :3

anyway, it's not possible to force a player to jump even without using mcreator, so don't feel bad.

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, thanks a lot, I'll keep…
Sun, 03/22/2020 - 02:33

Ok, thanks a lot, I'll keep that in mind_ :)

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you can make the target…
Mon, 03/23/2020 - 19:16

you can make the target player accelerate upwards to produce a jumping effect. Just use a "Custom Code snippet" procedure block and put this "entity.motionY += 0.1d;" in.

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hmm, I did what you…
Mon, 03/23/2020 - 19:37

Hmm, I did what you instructed, but it doesn't seems to work, the gradle task failed, thanks anyway :)

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
D:\my stuff\RWAS Resources…
Mon, 03/23/2020 - 19:39

D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: illegal start of expression
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
 ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: illegal start of expression
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
                        ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: not a statement
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
                          ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:51: error: ';' expected
}/entity.motionY+= 0.1d/if(entity instanceof EntityPlayer)
                                                          ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: not a statement
   ((EntityPlayer)entity).inventory
     ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: ';' expected
   ((EntityPlayer)entity).inventory
                 ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: not a statement
   ((EntityPlayer)entity).inventory
                  ^
D:\my stuff\RWAS Resources\RWASWorkspace\build\sources\main\java\net\mcreator\rwas\MCreatorSheathedFatesEndRangedBulletHitsBlock.java:52: error: ';' expected
   ((EntityPlayer)entity).inventory
                        ^
8 errors
:compileJava FAILED

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Did I do something wrong?
Mon, 03/23/2020 - 19:47

Did I do something wrong?

Last seen on 05:29, 31. Jan 2022
Joined Nov 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Maybe if you pasted a screen…
Tue, 03/24/2020 - 11:51

Maybe if you pasted a screen shot of the procedure? Judging by the error output it looks like you didn't put in the semicolon at the end of the statement.

Last seen on 15:10, 2. Feb 2021
Joined May 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
sorry because I answer this…
Wed, 03/25/2020 - 17:04

sorry because I answer this a bit late, here is the screenshot of the procedure after I added a semilocon at the end of the statement (but it still doesn't work)

procedure: https://imgur.com/tWrpL23

Last seen on 14:58, 2. Oct 2020
Joined Feb 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You left forward-slashes at…
Mon, 09/14/2020 - 12:13

You left forward-slashes at the start and end of the code snippet! Those are there because the default text is a multi-line comment that says "code".

/*code*/
entity.motionY += 0.1d;

 

Last seen on 14:15, 15. Oct 2023
Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ive tried adding that…
Fri, 02/04/2022 - 18:39

Ive tried adding that command too and it just doesnt work and gets compilation errors, im kinda new to the program i have no idea if i messed something up, yes i tried putting the ; but it still doesnt work

Last seen on 12:40, 16. Jun 2022
Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I tried doing this too but…
Thu, 02/10/2022 - 21:46

I tried doing this too but it gave me a warning saying that the following items don't compile properly and the only item on the list was the procedure