Started by
TTrixPlays
on
Topic category: Advanced modding
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)
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
Thanks ill try
@#2 Just keep in mind that you can only use commands in events if your world is set to have cheats on.
@#2.1 I know
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"}");}
@#3 Sorry, I can't help you with that :(
Hey I've seen your mod do your have any trouble with anything?
@#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).
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...
Hmmm.... I got it to paste the tellraw in chat i just can't give it color.
@#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