How to force player doing something?

Started by QB on Sat, 03/21/2020 - 14:03

Topic category: Help with modding (Java Edition)

Last seen on 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to force player doing something?
Sat, 03/21/2020 - 14:03

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

Last seen on 19:55, 25. Mar 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 19:55, 25. Mar 2020
Joined Mar 2020
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 18:04, 26. Nov 2020
Joined Nov 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

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

Did I do something wrong?

Last seen on 18:04, 26. Nov 2020
Joined Nov 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 09:09, 23. Nov 2020
Joined May 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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;