jstN0body
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by jstN0body
-
Ok, but I still have the line if (!(event.getEntity() instanceof PlayerEntity)) return; so do you know why it's not only affecting players?
-
@SubscribeEvent public void onSizeChange(PlayerEvent.Size event) { if (!(event.getEntity() instanceof PlayerEntity)) return; EntitySize newSize; switch (event.getPose()) { case CROUCHING: newSize = EntitySize.fixed(0.6f * SizeMod.sizePercentage, 1.5f * SizeMod.sizePercentage); break; case SWIMMING: case FALL_FLYING: newSize = EntitySize.fixed(0.6f * SizeMod.sizePercentage, 0.6f * SizeMod.sizePercentage); break; case SLEEPING: newSize = EntitySize.fixed(0.2f * SizeMod.sizePercentage, 0.2f * SizeMod.sizePercentage); break; case DYING: newSize = EntitySize.fixed(0.01f, 0.01f); break; default: newSize = EntitySize.fixed(0.6f * SizeMod.sizePercentage, 1.8f * SizeMod.sizePercentage); } event.setNewSize(newSize); event.setNewEyeHeight(newSize.height * 0.9f); } I can't seem to figure out what's going wrong with my code. It seems like it should only affect players but any mob that spawns has its hitbox changed as well as any item that's dropped. Does anyone happen to know what's going on here?
-
Ok, where would I be able to see the code for horses?
-
Trying to make a bee move where I want at a normal speed, but it's always moving super fast, I've tried using setMotion() move() and setVelocity() but it's always moving super fast, anyone know what's going on? @SubscribeEvent public void onPlayerTick(TickEvent.PlayerTickEvent event) { if (event.player.getRidingEntity() == null) return; Entity entity = event.player.getRidingEntity(); switch (event.player.getHeldItemMainhand().getItem().getRegistryName().toString()) { case "sizemod:flower_on_a_stick": if (entity.getType() == EntityType.BEE) { entity.setVelocity(event.player.getForward().x / 100, event.player.getForward().y / 100, event.player.getForward().z / 100); } } }
-
Ok, I moved the render events to a class called Render, but I still have the same problem where I shrink for a split second and go back to normal. It works fine singleplayer, just not on a server. I can however, change my size in singleplayer and then connect to the server and remain that same size. Any ideas on what's happening? @Mod(SizeMod.MODID) public class SizeMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public static final String MODID = "sizemod"; public static final String VERSION = "1.1.2"; public static float sizePercentage = 1.0f; public SizeMod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true)); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> Render::new); MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code } private void doClientStuff(final FMLClientSetupEvent event) { } private void enqueueIMC(final InterModEnqueueEvent event) { // some example code to dispatch IMC to another mod } private void processIMC(final InterModProcessEvent event) { // some example code to receive and process InterModComms from other mods } @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { ModCommands.register(event.getServer().getCommandManager().getDispatcher()); } @SubscribeEvent public void onSizeChange(PlayerEvent.Size event) { if (event.getEntity() instanceof PlayerEntity) { EntitySize newSize; switch (event.getPose()) { case CROUCHING: newSize = EntitySize.fixed(0.6f * sizePercentage, 1.5f * sizePercentage); break; case SWIMMING: case FALL_FLYING: newSize = EntitySize.fixed(0.6f * sizePercentage, 0.6f * sizePercentage); break; case SLEEPING: newSize = EntitySize.fixed(0.2f * sizePercentage, 0.2f * sizePercentage); break; default: newSize = EntitySize.fixed(0.6f * sizePercentage, 1.8f * sizePercentage); } event.setNewSize(newSize); event.setNewEyeHeight(newSize.height * 0.9f); } } @SubscribeEvent public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) { if (!(event.getEntity() instanceof PlayerEntity)) return; SizeMod.sizePercentage -= 0.01; for (ServerPlayerEntity player : event.getPlayer().getServer().getPlayerList().getPlayers()) { player.setBoundingBox(AxisAlignedBB.func_241550_g_(0.6, 1.8, 0.6)); player.sendStatusMessage(new TranslationTextComponent("Your size is now: " + new DecimalFormat("0.00").format(SizeMod.sizePercentage*100) + "%"), true); } } int hunger; float saturation; @SubscribeEvent public void startPlayerEat(LivingEntityUseItemEvent.Start event) { if (event.getItem().isFood() && event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); FoodStats foodStats = player.getFoodStats(); hunger = foodStats.getFoodLevel(); saturation = foodStats.getSaturationLevel(); } } @SubscribeEvent public void finishPlayerEat(LivingEntityUseItemEvent.Finish event) { if (event.getItem().isFood() && event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); FoodStats foodStats = player.getFoodStats(); hunger = foodStats.getFoodLevel() - hunger; saturation = foodStats.getSaturationLevel() - saturation; hunger *= (1 - sizePercentage); saturation *= (1 - sizePercentage); foodStats.addStats(Math.round(hunger), saturation); } } // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { // register a new block here } } } public class Render { public Render() { MinecraftForge.EVENT_BUS.register(this); } @SubscribeEvent public void preRenderPlayer(RenderPlayerEvent.Pre event) { event.getMatrixStack().push(); event.getMatrixStack().scale(SizeMod.sizePercentage, SizeMod.sizePercentage, SizeMod.sizePercentage); } @SubscribeEvent public void postRenderPlayer(RenderPlayerEvent.Post event) { event.getMatrixStack().pop(); } }
-
Ok, so after I move it to a separate class, how do I make it so that is only run by the client?
-
@Mod(SizeMod.MODID) public class SizeMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public static final String MODID = "sizemod"; public static final String VERSION = "1.1.2"; public static float sizePercentage = 1.0f; public SizeMod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true)); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code } private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client } private void enqueueIMC(final InterModEnqueueEvent event) { // some example code to dispatch IMC to another mod } private void processIMC(final InterModProcessEvent event) { // some example code to receive and process InterModComms from other mods } @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { ModCommands.register(event.getServer().getCommandManager().getDispatcher()); } @SubscribeEvent public void onSizeChange(PlayerEvent.Size event) { if (event.getEntity() instanceof PlayerEntity) { EntitySize newSize; switch (event.getPose()) { case CROUCHING: newSize = EntitySize.fixed(0.6f * sizePercentage, 1.5f * sizePercentage); break; case SWIMMING: case FALL_FLYING: newSize = EntitySize.fixed(0.6f * sizePercentage, 0.6f * sizePercentage); break; case SLEEPING: newSize = EntitySize.fixed(0.2f * sizePercentage, 0.2f * sizePercentage); break; default: newSize = EntitySize.fixed(0.6f * sizePercentage, 1.8f * sizePercentage); } event.setNewSize(newSize); event.setNewEyeHeight(newSize.height * 0.9f); } } @OnlyIn(Dist.CLIENT) @SubscribeEvent public void preRenderPlayer(RenderPlayerEvent.Pre event) { event.getMatrixStack().push(); event.getMatrixStack().scale(sizePercentage, sizePercentage, sizePercentage); } @OnlyIn(Dist.CLIENT) @SubscribeEvent public void postRenderPlayer(RenderPlayerEvent.Post event) { event.getMatrixStack().pop(); } @SubscribeEvent public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) { if (!(event.getEntity() instanceof PlayerEntity)) return; SizeMod.sizePercentage -= 0.01; for (ServerPlayerEntity player : event.getPlayer().getServer().getPlayerList().getPlayers()) { player.setBoundingBox(AxisAlignedBB.func_241550_g_(0.6, 1.8, 0.6)); player.sendStatusMessage(new TranslationTextComponent("Your size is now: " + new DecimalFormat("0.00").format(SizeMod.sizePercentage*100) + "%"), true); } } int hunger; float saturation; @SubscribeEvent public void startPlayerEat(LivingEntityUseItemEvent.Start event) { if (event.getItem().isFood() && event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); FoodStats foodStats = player.getFoodStats(); hunger = foodStats.getFoodLevel(); saturation = foodStats.getSaturationLevel(); } } @SubscribeEvent public void finishPlayerEat(LivingEntityUseItemEvent.Finish event) { if (event.getItem().isFood() && event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); FoodStats foodStats = player.getFoodStats(); hunger = foodStats.getFoodLevel() - hunger; saturation = foodStats.getSaturationLevel() - saturation; hunger *= (1 - sizePercentage); saturation *= (1 - sizePercentage); foodStats.addStats(Math.round(hunger), saturation); } } // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { // register a new block here } } }
-
Ok, I have set the render events as only client accessible, and the server starts, however, when trying to scale the player, the player shrinks for a split second and then goes back to normal.
-
Weird, IntelliJ is giving me an error saying lambda targets must be interfaces.
-
Basically the title, I'm just trying to figure out what to do to get this working in a 1.16.3 mod, I was going to use the snippet from the documentation, but it doesn't work in 1.16, anyone have an updated version? (here's the snippet from the docs) ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, () -> Pair.of(() -> FMLNetworkConstants.IGNORESERVERONLY, (a, b) -> true));
-
Sorry if I'm being dumb, but wdym "other places."
-
Currently reading the docs, here's the code of the class where I'm getting the error just in case: @Mod(SizeMod.MODID) public class SizeMod { // Directly reference a log4j logger. private static final Logger LOGGER = LogManager.getLogger(); public static final String MODID = "sizemod"; public static final String VERSION = "1.0.0"; public static float sizePercentage = 1.0f; public SizeMod() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the enqueueIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::enqueueIMC); // Register the processIMC method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::processIMC); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); } private void setup(final FMLCommonSetupEvent event) { // some preinit code } private void doClientStuff(final FMLClientSetupEvent event) { // do something that can only be done on the client } private void enqueueIMC(final InterModEnqueueEvent event) { // some example code to dispatch IMC to another mod } private void processIMC(final InterModProcessEvent event) { // some example code to receive and process InterModComms from other mods } // You can use SubscribeEvent and let the Event Bus discover methods to call @SubscribeEvent public void onServerStarting(FMLServerStartingEvent event) { ModCommands.register(event.getServer().getCommandManager().getDispatcher()); } @SubscribeEvent public void onSizeChange(PlayerEvent.Size event) { if (event.getEntity() instanceof PlayerEntity) { EntitySize newSize; switch (event.getPose()) { case CROUCHING: newSize = EntitySize.fixed(0.6f * sizePercentage, 1.5f * sizePercentage); break; case SWIMMING: case FALL_FLYING: newSize = EntitySize.fixed(0.6f * sizePercentage, 0.6f * sizePercentage); break; case SLEEPING: newSize = EntitySize.fixed(0.2f * sizePercentage, 0.2f * sizePercentage); break; default: newSize = EntitySize.fixed(0.6f * sizePercentage, 1.8f * sizePercentage); } event.setNewSize(newSize); event.setNewEyeHeight(newSize.height * 0.9f); } } @SubscribeEvent public void preRenderPlayer(RenderPlayerEvent.Pre event) { event.getMatrixStack().push(); event.getMatrixStack().scale(sizePercentage, sizePercentage, sizePercentage); } @SubscribeEvent public void postRenderPlayer(RenderPlayerEvent.Post event) { event.getMatrixStack().pop(); } @SubscribeEvent public void onPlayerRespawn(PlayerEvent.PlayerRespawnEvent event) { if (!(event.getEntity() instanceof PlayerEntity)) return; SizeMod.sizePercentage -= 0.01; for (ServerPlayerEntity player : event.getPlayer().getServer().getPlayerList().getPlayers()) { player.setBoundingBox(AxisAlignedBB.func_241550_g_(0.6, 1.8, 0.6)); player.sendStatusMessage(new TranslationTextComponent("Your size is now: " + new DecimalFormat("0.00").format(SizeMod.sizePercentage*100) + "%"), true); } } int hunger; float saturation; @SubscribeEvent public void startPlayerEat(LivingEntityUseItemEvent.Start event) { if (event.getItem().isFood() && event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); FoodStats foodStats = player.getFoodStats(); hunger = foodStats.getFoodLevel(); saturation = foodStats.getSaturationLevel(); } } @SubscribeEvent public void finishPlayerEat(LivingEntityUseItemEvent.Finish event) { if (event.getItem().isFood() && event.getEntity() instanceof PlayerEntity) { PlayerEntity player = (PlayerEntity) event.getEntity(); FoodStats foodStats = player.getFoodStats(); hunger = foodStats.getFoodLevel() - hunger; saturation = foodStats.getSaturationLevel() - saturation; hunger *= (1 - sizePercentage); saturation *= (1 - sizePercentage); foodStats.addStats(Math.round(hunger), saturation); } } // You can use EventBusSubscriber to automatically subscribe events on the contained class (this is subscribing to the MOD // Event bus for receiving Registry Events) @Mod.EventBusSubscriber(bus=Mod.EventBusSubscriber.Bus.MOD) public static class RegistryEvents { @SubscribeEvent public static void onBlocksRegistry(final RegistryEvent.Register<Block> blockRegistryEvent) { // register a new block here } } }
-
I can't run my mod on a dedicated server because of this? Is there any way to fix this? java.lang.RuntimeException: Attempted to load class net/minecraft/client/renderer/entity/PlayerRenderer for invalid dist DEDICATED_SERVER at net.minecraftforge.fml.loading.RuntimeDistCleaner.processClassWithFlags(RuntimeDistCleaner.java:71) ~[forge.jar:34.1] {} at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:85) ~[modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:119) ~[modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.TransformingClassLoader$DelegatedClassLoader.findClass(TransformingClassLoader.java:256) ~[modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:135) ~[modlauncher-7.0.1.jar:?] {re:classloading} at cpw.mods.modlauncher.TransformingClassLoader.loadClass(TransformingClassLoader.java:97) ~[modlauncher-7.0.1.jar:?] {re:classloading} at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.getDeclaredConstructors0(Native Method) ~[?:1.8.0_271] {} at java.lang.Class.privateGetDeclaredConstructors(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.getConstructor(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.eventbus.api.EventListenerHelper.computeListenerList(EventListenerHelper.java:96) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerListInternal(EventListenerHelper.java:63) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.api.EventListenerHelper.getListenerList(EventListenerHelper.java:48) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.addToListeners(EventBus.java:263) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.register(EventBus.java:256) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.registerListener(EventBus.java:150) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.lambda$null$6(EventBus.java:98) ~[eventbus-3.0.3-service.jar:?] {} at java.util.Optional.ifPresent(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.eventbus.EventBus.lambda$registerObject$7(EventBus.java:98) ~[eventbus-3.0.3-service.jar:?] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ReferencePipeline$2$1.accept(Unknown Source) ~[?:1.8.0_271] {} at java.util.Spliterators$ArraySpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_271] {} at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.eventbus.EventBus.registerObject(EventBus.java:94) ~[eventbus-3.0.3-service.jar:?] {} at net.minecraftforge.eventbus.EventBus.register(EventBus.java:120) ~[eventbus-3.0.3-service.jar:?] {} at com.github.jstN0body.shrinkmod.SizeMod.<init>(SizeMod.java:58) ~[?:1.0] {re:classloading} at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_271] {} at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_271] {} at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_271] {} at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_271] {} at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:81) ~[?:34.1] {re:classloading} at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$5(ModContainer.java:111) ~[?:?] {re:classloading} at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_271] {} at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_271] {} [m[1;31m[19:05:24] [main/FATAL] [ne.mi.fm.ModLoader/LOADING]: Failed to complete lifecycle event CONSTRUCT, 1 errors found [m[32m[19:05:24] [main/INFO] [STDOUT/]: [net.minecraft.crash.CrashReport:func_85057_a:196]: Negative index in crash report handler (16/18) [m[1;31m[19:05:24] [main/FATAL] [ne.mi.fm.se.ServerModLoader/]: Crash report saved to .\crash-reports\crash-2020-11-09_19.05.24-fml.txt [m---- Minecraft Crash Report ---- // This doesn't make any sense! Time: 11/9/20 7:05 PM Description: Mod loading error has occurred java.lang.Exception: Mod Loading has failed at net.minecraftforge.fml.CrashReportExtender.dumpModLoadingCrashReport(CrashReportExtender.java:85) ~[?:?] {re:classloading} at net.minecraftforge.fml.server.ServerModLoader.load(ServerModLoader.java:51) ~[?:?] {re:classloading} at net.minecraft.server.Main.main(Main.java:96) ~[?:?] {re:classloading} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_271] {} at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_271] {} at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_271] {} at net.minecraftforge.fml.loading.FMLServerLaunchProvider.lambda$launchService$0(FMLServerLaunchProvider.java:51) ~[forge.jar:34.1] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:81) [modlauncher-7.0.1.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-7.0.1.jar:?] {} at net.minecraftforge.server.ServerMain$Runner.runLauncher(ServerMain.java:63) [forge.jar:?] {} at net.minecraftforge.server.ServerMain$Runner.access$100(ServerMain.java:60) [forge.jar:?] {} at net.minecraftforge.server.ServerMain.main(ServerMain.java:57) [forge.jar:?] {}
-
Trying to add an argument to my command, but whenever I run the command it tells me that the command is "unknown or incomplete". I can't find any real error message other than that. Anyone know what I did wrong here? public class SizeCommand implements Command<CommandSource> { private static final SizeCommand COMMAND = new SizeCommand(); public static ArgumentBuilder<CommandSource, ?> register(CommandDispatcher<CommandSource> dispatcher) { return Commands.literal("scale") .then(Commands.argument("size", FloatArgumentType.floatArg())) .requires(cs -> cs.hasPermissionLevel(0)) .executes(COMMAND); } @Override public int run(CommandContext<CommandSource> context) throws CommandSyntaxException { ServerPlayerEntity player = context.getSource().asPlayer(); SizeMod.sizePercentage = FloatArgumentType.getFloat(context, "size"); player.sendStatusMessage(new TranslationTextComponent("Size updated."), true); return 0; } }
-
Working code snippet for anyone who wants it: @SubscribeEvent public void preRenderPlayer(RenderPlayerEvent.Pre event) { event.getMatrixStack().push(); event.getMatrixStack().scale(0.5f, 0.5f, 0.5f); } @SubscribeEvent public void postRenderPlayer(RenderPlayerEvent.Post event) { event.getMatrixStack().pop(); }
-
Not sure what I've messed up here, but I've been trying to scale the player model, and basically no matter what value I try to scale to, the player is like the size of a house. Any ideas of what's going wrong here? @SubscribeEvent public void preRenderPlayer(RenderPlayerEvent.Pre event) { event.getMatrixStack().scale(0.25f, 0.5f, 0.25f); event.getMatrixStack().pop(); event.getMatrixStack().push(); } @SubscribeEvent public void postRenderPlayer(RenderPlayerEvent.Post event) { event.getMatrixStack().getLast(); }
-
[1.16.3] [SOLVED] setBoundingBox() method not working?
jstN0body replied to jstN0body's topic in Modder Support
Ah yes, that's working ty! -
Maybe I'm just going crazy and doing something completely wrong, but I have a simple command set up that should shrink the hitbox of the player by a little bit: @Override public int run(CommandContext<CommandSource> context) throws CommandSyntaxException { ServerPlayerEntity player = context.getSource().asPlayer(); player.setBoundingBox(player.getBoundingBox().shrink(1)); player.sendStatusMessage(new TranslationTextComponent("Size updated."), true); return 0; } This is the code that should be executed when the command is run. The status message is sent and no errors are thrown, but the hitbox remains the same. Anyone know what's going on?