Execute tellraw command when collided with block

Started by TTrixPlays on

Topic category: Advanced modding

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

  • Modifications: 1
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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)

Active 5 years ago
Joined Aug 2017
Points:
819

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 206
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

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

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

Thanks ill try

Active 5 years ago
Joined Aug 2017
Points:
819

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 206
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.

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

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

@#2.1 I know

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

  • Modifications: 1
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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"}");}

Active 5 years ago
Joined Aug 2017
Points:
819

User statistics:

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

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

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

  • Modifications: 1
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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?

Active 5 years ago
Joined Aug 2017
Points:
819

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 206
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).

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

  • Modifications: 1
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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...

Active 4 years ago
Joined Jul 2017
Points:
746

User statistics:

  • Modifications: 1
  • Forum topics: 6
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 29
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.

Active 5 years ago
Joined Aug 2017
Points:
819

User statistics:

  • Modifications: 0
  • Forum topics: 5
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 206
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