-
Posts
56 -
Joined
-
Last visited
Everything posted by MrNoodles75
-
@Draco18s I have been figuring everything out since then, by going through the default code and getting information on how to do something
-
@DaemonUmbra I actually followed Jorrit Tyberghein
-
well it does
-
it still works
-
@diesieben07 that is correct but my excuse is that I am new to this whole modding thing and there was only one tutorial I could find on youtube. but... I did make it work, and although it is probably inefficient it does work. so what I found was that when clicking the block it would run the method twice(before you ask I couldn't find a reason) so I coded it to only say something every other time the method is run. protected int conversation = 1; protected boolean isTalking = false; protected boolean canTalk = true; @Override public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult result) { if (canTalk) { isTalking = true; canTalk = false; } else { canTalk = true; } if (isTalking) { if (conversation == 1) { player.sendMessage(new TranslationTextComponent("computerTalk.hello")); isTalking = false; conversation++; } else if (conversation == 2) { player.sendMessage(new TranslationTextComponent("computerTalk.whatdoyouneed")); isTalking = false; conversation++; } else if (conversation == 3) { player.sendMessage(new TranslationTextComponent("computerTalk.goodbye")); isTalking = false; conversation = 1; } } return true; } witch works perfectly.
-
@diesieben07 is there a way to make it go only on the client or the server, so it only prints once
-
@diesieben07 thanks, now I am doing player.sendMessage(new TranslationTextComponent("computerTalk.hello")); but it now prints it twice and throughs an error: [16:40:24.467] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server java.lang.IllegalStateException: Our named container provider is missing! at com.runningmanstudios.harrysmod.blocks.Computer.onBlockActivated(Computer.java:62) ~[?:?] {} at net.minecraft.block.BlockState.onBlockActivated(BlockState.java:296) ~[?:?] {} at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:366) ~[?:?] {} at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:896) ~[?:?] {} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:42) ~[?:?] {} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:12) ~[?:?] {} at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:14) ~[?:?] {} at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[?:?] {} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:131) [?:?] {pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) [?:?] {} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:106) [?:?] {pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:713) [?:?] {pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:707) [?:?] {pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.drainTasks(ThreadTaskExecutor.java:93) [?:?] {pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:692) [?:?] {pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:637) [?:?] {pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_221] {}
-
So what I would like to do is make it so when you touch a block (click on it) then the block will say something like "what are you doing!" or "hello" in the chat but I seem to be getting stuck at the printing it to the chat. I looked around and I found protected Minecraft minecraft; @Override public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult result) { if (!world.isRemote) { TileEntity tileEntity = world.getTileEntity(pos); if (tileEntity instanceof INamedContainerProvider) { NetworkHooks.openGui((ServerPlayerEntity) player, (INamedContainerProvider) tileEntity, tileEntity.getPos()); } else { throw new IllegalStateException("Our named container provider is missing!"); } return true; } //THIS SENDS THE MESSAGE this.minecraft.player.sendChatMessage("hello I am a COMPUTER"); //THAT SENDS THE MESSAGE return super.onBlockActivated(state, world, pos, player, hand, result); } But that does not work, instead, the game crashes.
-
[SOLVED][1.14.3] age=<number> does not work in blockstate json.
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@Draco18s okay, I will do that -
[SOLVED][1.14.3] age=<number> does not work in blockstate json.
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@Draco18s if you could tell me I would be happy. it seems the larger the text I paste into the spoiler the more whitespace there is, maybe it is that I am pasting it straight from IntelliJ -
I am trying to make termite nests and when the nests are a certain age you can click them with a hoe to get termites. so I tried doing this: but that didn't seem to work. as you can see I am getting the termites from a ModItems class that looks like this witch is from the Termite class: and then I create the item in my Main Mod Class here: but the block never drops the item.
-
So in my mod, there are Termite nests that grow upwards and outwards, and I want them to have different textures as the nests grow older. to do that I did this: but that did not work (before you ask the block models are referring to actual pictures). and there doesn't seem to be anything wrong with my java file: so could someone help me?
-
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@diesieben07 okay, so I did this, I added a System.out.println(); and it didn't ever generate. I moved around the world so I would be generating new blocks but I never saw the message, meaning that it never got called. also if you look at the image above you can see that the method is unused but as you can see below the block registry and the item registry(also in RegistryEvents along with onInitBiomesGen()) are also unused but they still work. one more thing the answer could be that the method is within RegistryEvents and not in the ForgeEventSubscriber class -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@diesieben07 I looked through like 30 cave systems already and made it as common as coal but couldn't find it so I will just trust you that it is there -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@diesieben07 so, @SubscribeEvent public static void onInitBiomesGen(FMLCommonSetupEvent event) { for (Biome biome : ForgeRegistries.BIOMES) { biome.addFeature( GenerationStage.Decoration.UNDERGROUND_ORES, Biome.createDecoratedFeature( Feature.ORE, new OreFeatureConfig(OreFeatureConfig.FillerBlockType.NATURAL_STONE, ModBlocks.PLASTICORE.getDefaultState(), PlasticOre.veinSize), Placement.COUNT_RANGE, new CountRangeConfig(PlasticOre.veinCount, PlasticOre.heightMin, PlasticOre.heightBase, PlasticOre.heightMax)) ); } } -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@diesieben07 so what is the correct way of doing it -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@diesieben07 what's wrong with BiomeSize? -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@Yanny7 but can you give me a suggestion of what values to put there? -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@Yanny7 thanks but what do the variables do? eg. veinSize, veinCount, heightMin. because I tried looking around for Minecraft classes that use them but couldn't find anything. -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@Yanny7 Thanks, but one more thing, so my blocks are created in a class and then the item form of the block is made in a ModBlocks class. so should I use the ModBlocks Version or the regular class version? when I use the class it says Non-static method getDefaultState() cannot be referenced from a static context. so I should use ModBlocks.PLASTICORE right? -
[1.14.3] make blocks naturally generate
MrNoodles75 replied to MrNoodles75's topic in Modder Support
@Yanny7 when I do this I get an error because it does not know what OresEnum is. for (OresEnum oresEnum : OresEnum.values()) { ^ symbol: variable OresEnum -
is there a way to make my custom blocks naturally generate. eg. flowers generating in biomes; ores generating in caves and stone
-
I want to make advancements so wen you hold a block then you get one (or more) recipes. how do you do this?
-
I am trying to make a block that outputs a ton of Redstone power, like maybe 100 or something. how would I do this? [SOLVED] The answer is this: public int getWeakPower(BlockState blockState, IBlockReader blockAccess, BlockPos pos, Direction side) { return 30; } public boolean canProvidePower(BlockState state) { return true; }