like from a gun? you have to use a global event that changes player's roll/pitch/yaw. but mcreator doesn't have that global trigger in procedures yet. so as of now coding is required.
entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
Under your ranged item, there is an item right-click function I believe. In the procedure it calls, you can most likely use the snippet above in a custom snippet (under advanced tab).
Note: You may get an "error: can not find symbol", that is most likely due to the Random() class not being found or the entity. If you get this error post full log, and all code used.
Executing Gradle task: build
Build info: MCreator 2020.3.22116, forge-1.15.2, 64-bit, 4009 MB, Windows 10, JVM 1.8.0_252, JAVA_HOME: C:\Users\charl\Desktop\acces\mcreator2\MCreator\jdk
> Configure project :
New Dep: net.minecraftforge:forge:1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1
> Task :compileJava C:\Users\charl\MCreatorWorkspaces\end_of_humanity\src\main\java\net\mcreator\end_of_humanity\procedures\Ak47RangedItemUsedProcedure.java:14: error: cannot find symbol entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
^
symbol: variable entity
location: class Ak47RangedItemUsedProcedure C:\Users\charl\MCreatorWorkspaces\end_of_humanity\src\main\java\net\mcreator\end_of_humanity\procedures\Ak47RangedItemUsedProcedure.java:14: error: cannot find symbol entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
^
symbol: variable entity
location: class Ak47RangedItemUsedProcedure
2 errors
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#se…
BUILD FAILED in 2m 38s
1 actionable task: 1 executed
BUILD FAILED
Task completed in 171645 milliseconds
also, idk if you're interested but im making a zombie apocalypse mod and im gonna make it big, or try to, idk if you wanna join https://discord.gg/YMMXGRX
@EndOfHumanityModElements.ModElement.Tag
public class Ak47RangedItemUsedProcedure extends EndOfHumanityModElements.ModElement {
public Ak47RangedItemUsedProcedure(EndOfHumanityModElements instance) {
super(instance, 35);
}
public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
}
}
@EndOfHumanityModElements.ModElement.Tag
public class Ak47RangedItemUsedProcedure extends EndOfHumanityModElements.ModElement {
public Ak47RangedItemUsedProcedure(EndOfHumanityModElements instance) {
super(instance, 35);
}
public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
like from a gun? you have to use a global event that changes player's roll/pitch/yaw. but mcreator doesn't have that global trigger in procedures yet. so as of now coding is required.
Why would you use a "global" trigger?? You already have;
And we are using a "ranged-item", which should extend Item.
And then from there, it is as simple as setting the players rotationPitch;
The above ^^ could just be put in a custom snippet, however, to follow MCreators dependencies. It should look similar to;
Note: You can do the same with rotationYaw, <- & ->.
Thanks!
where do i add that and how does it work? (sorry, idk anything about coding)
Under your ranged item, there is an item right-click function I believe. In the procedure it calls, you can most likely use the snippet above in a custom snippet (under advanced tab).
Note: You may get an "error: can not find symbol", that is most likely due to the Random() class not being found or the entity. If you get this error post full log, and all code used.
thanks a ton for the help bro!
Executing Gradle task: build
Build info: MCreator 2020.3.22116, forge-1.15.2, 64-bit, 4009 MB, Windows 10, JVM 1.8.0_252, JAVA_HOME: C:\Users\charl\Desktop\acces\mcreator2\MCreator\jdk
> Configure project :
New Dep: net.minecraftforge:forge:1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1
> Task :compileJava
C:\Users\charl\MCreatorWorkspaces\end_of_humanity\src\main\java\net\mcreator\end_of_humanity\procedures\Ak47RangedItemUsedProcedure.java:14: error: cannot find symbol entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
^
symbol: variable entity
location: class Ak47RangedItemUsedProcedure
C:\Users\charl\MCreatorWorkspaces\end_of_humanity\src\main\java\net\mcreator\end_of_humanity\procedures\Ak47RangedItemUsedProcedure.java:14: error: cannot find symbol entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
^
symbol: variable entity
location: class Ak47RangedItemUsedProcedure
2 errors
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/4.10.3/userguide/command_line_interface.html#se…
BUILD FAILED in 2m 38s
1 actionable task: 1 executed
BUILD FAILED
Task completed in 171645 milliseconds
lol
Yeah, I expected that. That's the variable, "entity", I will create it. Post all of the code inside the procedure.
also, idk if you're interested but im making a zombie apocalypse mod and im gonna make it big, or try to, idk if you wanna join https://discord.gg/YMMXGRX
package net.mcreator.end_of_humanity.procedures;
import net.mcreator.end_of_humanity.EndOfHumanityModElements;
import java.util.Random;
@EndOfHumanityModElements.ModElement.Tag
public class Ak47RangedItemUsedProcedure extends EndOfHumanityModElements.ModElement {
public Ak47RangedItemUsedProcedure(EndOfHumanityModElements instance) {
super(instance, 35);
}
public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
}
}
package net.mcreator.end_of_humanity.procedures;
import net.mcreator.end_of_humanity.EndOfHumanityModElements;
import net.minecraft.entity.LivingEntity;
import java.util.Random;
@EndOfHumanityModElements.ModElement.Tag
public class Ak47RangedItemUsedProcedure extends EndOfHumanityModElements.ModElement {
public Ak47RangedItemUsedProcedure(EndOfHumanityModElements instance) {
super(instance, 35);
}
public static void executeProcedure(java.util.HashMap<String, Object> dependencies) {
LivingEntity entity = (LivingEntity) dependencies.get("entity");
entity.rotationPitch = entity.rotationPitch - 10 - new Random().nextInt(5);
}
}
Note: This code should remain locked.
Regarding your above message, I can help, however, I am working on my own mod as well.
Can you help me with that? I am also making a zombie mod.
How can i help you?