Execute tellraw command when collided with block

Started by TTrixPlays on Sat, 08/19/2017 - 09:17

Topic category: Advanced modding

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Execute tellraw command when collided with block
Sat, 08/19/2017 - 09:17

Can someone help me I am trying to make it when I collide with my custom block it executes a tellraw or title command and instead it fails to compile so can someone give me a code or a command that wont fail... I am running on mcreator version 1.7.5 (1.11.2)

Last seen on 19:56, 11. Aug 2019
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
You can always use the print
Sat, 08/19/2017 - 10:07

You can always use the print text event thingy (I don't know what it's called). But if you want to use titles commands are the only option. Here are some examples of tellraw and title commands:

Tellraw:

tellraw @p {"text":"Testing","color":"green"}

Title:

title @p times 60 60 40     <---(first command) 

title @p title {"text":"Testing","color":"green"}    <--- (second command)

Generator for this cind of stuff: https://www.minecraftjson.com

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Thanks ill try
Sat, 08/19/2017 - 10:48

Thanks ill try

Last seen on 19:56, 11. Aug 2019
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:Thanks ill try
Sat, 08/19/2017 - 10:54

@#2 Just keep in mind that you can only use commands in events if your world is set to have cheats on.

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:RE:Thanks ill try
Sat, 08/19/2017 - 11:24

@#2.1 I know

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
It keeps coming up with 
Sat, 08/19/2017 - 11:28

It keeps coming up with 

C:\Pylo\MCreator175\forge\build\sources\main\java\mod\mcreator\mcreator_test.java:105: error: ')' expected
if(entity instanceof EntityPlayerMP){MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();if(minecraftserver!=null)minecraftserver.getCommandManager().executeCommand((EntityPlayerMP)entity, "tellraw @a {"text":"Test"}");}
                                                                                                                                                                                                                                                  ^
C:\Pylo\MCreator175\forge\build\sources\main\java\mod\mcreator\mcreator_test.java:105: error: not a statement
if(entity instanceof EntityPlayerMP){MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();if(minecraftserver!=null)minecraftserver.getCommandManager().executeCommand((EntityPlayerMP)entity, "tellraw @a {"text":"Test"}");}
                                                                                                                                                                                                                                                      ^
C:\Pylo\MCreator175\forge\build\sources\main\java\mod\mcreator\mcreator_test.java:105: error: ';' expected
if(entity instanceof EntityPlayerMP){MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();if(minecraftserver!=null)minecraftserver.getCommandManager().executeCommand((EntityPlayerMP)entity, "tellraw @a {"text":"Test"}");}
                                                                                                                                                                                                                                                         ^
C:\Pylo\MCreator175\forge\build\sources\main\java\mod\mcreator\mcreator_test.java:105: error: ';' expected
if(entity instanceof EntityPlayerMP){MinecraftServer minecraftserver = FMLCommonHandler.instance().getMinecraftServerInstance();if(minecraftserver!=null)minecraftserver.getCommandManager().executeCommand((EntityPlayerMP)entity, "tellraw @a {"text":"Test"}");}

Last seen on 19:56, 11. Aug 2019
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:It keeps coming up with 
Sat, 08/19/2017 - 11:29

@#3 Sorry, I can't help you with that :(

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hey I've seen your mod do
Sat, 08/19/2017 - 11:46

Hey I've seen your mod do your have any trouble with anything?

Last seen on 19:56, 11. Aug 2019
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:Hey I've seen your mod do
Sat, 08/19/2017 - 12:35

@#4 Yes, I actually have trubble with models. GandyManCan helped me to add these lines of code to make the model animate:

this.head.rotateAngleY = f3 / (180F / (float)Math.PI);
this.head.rotateAngleX = f4 / (180F / (float)Math.PI);
this.leftleg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;
this.rightleg.rotateAngleX = MathHelper.cos(f * 1.0F) * -1.0F * f1;

But the Problem is that the head won't animate correctly (I don't have any pictures of it on the computer i'm on right now).

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Yes creating custom mobs are
Sat, 08/19/2017 - 12:44

Yes creating custom mobs are a bit tricky. The mob still won't look bad if you don't animate the head sometimes I would not animate the head...

Last seen on 05:59, 8. Jul 2020
Joined Jul 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Hmmm.... I got it to paste
Sat, 08/19/2017 - 12:49

Hmmm.... I got it to paste the tellraw in chat i just can't give it color.

Last seen on 19:56, 11. Aug 2019
Joined Aug 2017
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
RE:Hmmm.... I got it to paste
Sat, 08/19/2017 - 12:59

@#6 You could use the Print Text In Chat Event Thingy that I mentioned earlier. Just put a custom color marker in the beginning of the sentence.

For example: §aTesting

Here you can find the custom color codes plus a generator for custom color commands in-game, if you want: http://colorcommandgenerator.ueuo.com/

Here is a YouTube tutorial for it: https://www.youtube.com/watch?v=nWHLLvcx1_0&t=9s