• Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm trying to register a custom Villager Profession but I'm not sure if what I'm doing is correct. The following runs without a hitch however the villagers never run the the block like they do other Job blocks and even if they are getting the job when I'm not looking, I'm unsure how to set a custom texture so they appear uniquely.   // ModProfessions.java public class ModProfessions { public static final DeferredRegister<VillagerProfession> PROFESSIONS = DeferredRegister .create(ForgeRegistries.PROFESSIONS, HuntingUpdate.MOD_ID); private static final ImmutableSet<Item> HUNTER_ITEMS = ImmutableSet.of(Items.BEEF, Items.PORKCHOP, Items.CHICKEN, Items.RABBIT, Items.RABBIT_HIDE, Items.MUTTON, Items.LEATHER, Items.COOKED_BEEF, Items.COOKED_PORKCHOP, Items.COOKED_CHICKEN, Items.COOKED_RABBIT, Items.COOKED_MUTTON); public static final RegistryObject<VillagerProfession> HUNTER = PROFESSIONS.register("hunter", () -> new VillagerProfession("hunter", new PointOfInterestType("hunting_table", ImmutableSet.of(ModBlocks.HUNTING_TABLE.get().getDefaultState()), 5, 40), HUNTER_ITEMS, ImmutableSet.of(ModBlocks.HUNTING_TABLE.get()), SoundEvents.ENTITY_VILLAGER_WORK_BUTCHER)); } // HuntingUpdate.java (Main Class) public HuntingUpdate() { // Register the setup method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::setup); // Register the doClientStuff method for modloading FMLJavaModLoadingContext.get().getModEventBus().addListener(this::doClientStuff); ModBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus()); ModItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus()); ModEntities.ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus()); ModProfessions.PROFESSIONS.register(FMLJavaModLoadingContext.get().getModEventBus()); // Register ourselves for server and other game events we are interested in MinecraftForge.EVENT_BUS.register(this); }   Any help would be super appreciated thanks!
    • Forgive me, Idk much about changing physics, but given you've been waiting 3 hours, you deserve a reply. Hopefully someone more experienced will give advice. Your formatting is fine, no worries. If you're willing to post your code, we can help you debug it.  When you say it's only working graphically, do you mean the entity/block rendering obeys your new physics, but not their bounding boxes/hit boxes? Also is this affecting vanilla blocks/entities, or only ones created in your mod?
    • I am having this issue when I launch Minecraft to test my mod, it crashes on the loading screen. It started happening after the computer was shutdown while Minecraft was loading ( a cat sat on the power button ). Even clearing the cache hasn't helped.   ---- Minecraft Crash Report ---- // You're mean. Time: 23/10/20 9:51 AM Description: Rendering overlay java.lang.NullPointerException: Rendering overlay at net.minecraftforge.fml.config.ModConfig.getFullPath(ModConfig.java:98) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException.<init>(ConfigFileTypeHandler.java:128) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:60) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:104) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:83) ~[?:?] {re:classloading} at java.lang.Iterable.forEach(Unknown Source) ~[?:1.8.0_261] {} at java.util.Collections$SynchronizedCollection.forEach(Unknown Source) ~[?:1.8.0_261] {} at net.minecraftforge.fml.config.ConfigTracker.loadConfigs(ConfigTracker.java:83) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModLoader.lambda$null$18(ModLoader.java:207) ~[?:?] {re:classloading} at net.minecraftforge.fml.DistExecutor.unsafeRunWhenOn(DistExecutor.java:125) ~[?:?] {re:classloading} at net.minecraftforge.fml.ModLoader.loadMods(ModLoader.java:207) ~[?:?] {re:classloading} at net.minecraftforge.fml.client.ClientModLoader.lambda$startModLoading$7(ClientModLoader.java:132) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.startModLoading(ClientModLoader.java:132) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$onResourceReload$2(ClientModLoader.java:114) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraftforge.fml.client.ClientModLoader.lambda$createRunnableWithCatch$4(ClientModLoader.java:123) ~[?:?] {re:classloading,pl:runtimedistcleaner:A} at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) ~[?:1.8.0_261] {} at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) ~[?:1.8.0_261] {} at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_261] {} at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_261] {} at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_261] {} at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_261] {} A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Render thread Stacktrace: at net.minecraftforge.fml.config.ModConfig.getFullPath(ModConfig.java:98) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigFileTypeHandler$ConfigLoadingException.<init>(ConfigFileTypeHandler.java:128) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigFileTypeHandler.lambda$reader$1(ConfigFileTypeHandler.java:60) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigTracker.openConfig(ConfigTracker.java:104) ~[?:?] {re:classloading} at net.minecraftforge.fml.config.ConfigTracker.lambda$loadConfigs$1(ConfigTracker.java:83) ~[?:?] {re:classloading} at java.lang.Iterable.forEach(Unknown Source) ~[?:1.8.0_261] {} at java.util.Collections$SynchronizedCollection.forEach(Unknown Source) ~[?:1.8.0_261] {} -- Overlay render details -- Details: Overlay name: net.minecraft.client.gui.ResourceLoadProgressGui Stacktrace: at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:483) ~[forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:953) ~[forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:584) ~[forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261] {} at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_261] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_261] {} at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_261] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar:?] {} 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.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar:?] {} -- System Details -- Details: Minecraft Version: 1.16.3 Minecraft Version ID: 1.16.3 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_261, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 590034736 bytes (562 MB) / 1631059968 bytes (1555 MB) up to 3799515136 bytes (3623 MB) CPUs: 12 JVM Flags: 1 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump ModLauncher: 7.0.1+78+master.e9771d8 ModLauncher launch target: fmluserdevclient ModLauncher naming: mcp ModLauncher services: /mixin-0.8.1.jar mixin PLUGINSERVICE /eventbus-3.0.3-service.jar eventbus PLUGINSERVICE /forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16-launcher.jar object_holder_definalize PLUGINSERVICE /forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16-launcher.jar runtime_enum_extender PLUGINSERVICE /accesstransformers-2.2.0-shadowed.jar accesstransformer PLUGINSERVICE /forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16-launcher.jar capability_inject_definalize PLUGINSERVICE /forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16-launcher.jar runtimedistcleaner PLUGINSERVICE /mixin-0.8.1.jar mixin TRANSFORMATIONSERVICE /forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16-launcher.jar fml TRANSFORMATIONSERVICE FML: 34.1 Forge: net.minecraftforge:34.1.0 FML Language Providers: javafml@34.1 minecraft@1 Mod List: client-extra.jar Minecraft {minecraft@1.16.3 COMMON_SETUP} main BetterStorageToo {betterstorage@version COMMON_SETUP} forge-1.16.3-34.1.0_mapped_snapshot_20200514-1.16.jar Forge {forge@34.1.0 COMMON_SETUP} main Stoney's Playground {playground@NONE COMMON_SETUP} Launched Version: MOD_DEV Backend library: LWJGL version 3.2.2 build 10 Backend API: GeForce GTX 1070/PCIe/SSE2 GL version 4.6.0 NVIDIA 456.71, NVIDIA Corporation GL Caps: Using framebuffer using OpenGL 3.0 Using VBOs: Yes Is Modded: Definitely; Client brand changed to 'forge' Type: Client (map_client.txt) Graphics mode: fancy Resource Packs: Current Language: English (US) CPU: 12x Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz   Anybody know what can be done to fix this?
    • Below are my capability classes for attaching to vanilla living entities (besides player). I'd like to change the entity's capability (to a value of 1.0F) when right clicking with a mod item. I thought this would be accomplished with: target.getCapability(ModCap.MOD_CAP).ifPresent(IModCap::set); But checking the values before and after with: System.out.println(target.getCapability(ModCap.MOD_CAP).orElse(new ModCapMethods()).get()); Still yields 0.0F (the default value). Since it returns the default, the capability should be registered (so ifPresent should pass?), but I could be wrong.    ModCap Class ModCapStorage Class ModCapMethods Class IModCap Class ModItem Class
    • I'm trying to make it so that witches drop a custom item I made. I read that I needed to use global loot modifiers and I am currently looking at the documentation as well as other posts online about how to use them and I can't seem to fully understand what I need to put in my code.   This is my what I have in my global_loot_modifiers.json: { "replace": false, "entries": [ "global_loot_test:witch" ] }   my witch.json: { "type": "mwh:dust_drop", "conditions": [ { "condition": "minecraft:killed_by_player" }, { "condition": "minecraft:entity_properties", "predicate": { "type": "minecraft:witch" }, "entity": "this" } ], "item": "mwh:witch_dust" }   and my modifier class: class VanillaMobModifier extends LootModifier { private final int numSeedsToConvert; private final Item itemToCheck; private final Item itemReward; public VanillaMobModifier(ILootCondition[] conditionsIn, int numSeeds, Item itemCheck, Item reward) { super(conditionsIn); numSeedsToConvert = numSeeds; itemToCheck = itemCheck; itemReward = reward; } @Nonnull @Override public List<ItemStack> doApply(List<ItemStack> generatedLoot, LootContext context) { // // Additional conditions can be checked, though as much as possible should be parameterized via JSON data. // It is better to write a new ILootCondition implementation than to do things here. // int numSeeds = 0; for(ItemStack stack : generatedLoot) { if(stack.getItem() == itemToCheck) numSeeds+=stack.getCount(); } if(numSeeds >= numSeedsToConvert) { generatedLoot.removeIf(x -> x.getItem() == itemToCheck); generatedLoot.add(new ItemStack(itemReward, (numSeeds/numSeedsToConvert))); numSeeds = numSeeds%numSeedsToConvert; if(numSeeds > 0) generatedLoot.add(new ItemStack(itemToCheck, numSeeds)); } return generatedLoot; } @SuppressWarnings("unused") private static class Serializer extends GlobalLootModifierSerializer<VanillaMobModifier> { @Override public VanillaMobModifier read(ResourceLocation name, JsonObject object, ILootCondition[] conditionsIn) { int numSeeds = JSONUtils.getInt(object, "numSeeds"); Item seed = ForgeRegistries.ITEMS.getValue(new ResourceLocation((JSONUtils.getString(object, "seedItem")))); Item wheat = ForgeRegistries.ITEMS.getValue(new ResourceLocation(JSONUtils.getString(object, "replacement"))); return new VanillaMobModifier(conditionsIn, numSeeds, seed, wheat); } @Override public JsonObject write(VanillaMobModifier instance) { // TODO Auto-generated method stub return null; } } }   I don't know how to modify this part of the code to fit my needs. I only want just witches to have a chance at dropping my item when killed.     And I saw that I needed to do something like this:   @SubscribeEvent public static void registerModifierSerializers(@Nonnull final RegistryEvent.Register<GlobalLootModifierSerializer<?>> event) { if (ENABLE) { event.getRegistry().register(new VanillaMobDropsModifier.Serializer().setRegistryName(new ResourceLocation(MOD_ID,"dust_drop"))); } }   buts it's giving me errors. Pretty sure I'm missing something. I bet I'm probably missing important or obvious but if anyone can point me in the right direction I would very my appreciate it.
  • Topics

  • Who's Online (See full list)