Execute tellraw command when collided with block

Started by TTrixPlays on

Topic category: Advanced modding

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Execute tellraw command when collided with block

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)

Joined Aug 2017
Points:

User statistics:

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

Joined Jul 2017
Points:

User statistics:

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

Thanks ill try

Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Joined Jul 2017
Points:

User statistics:

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

@#2.1 I know

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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"}");}

Joined Aug 2017
Points:

User statistics:

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

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

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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?

Joined Aug 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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).

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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...

Joined Jul 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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.

Joined Aug 2017
Points:

User statistics:

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