Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

gradlew genEclipseRuns stuck at 88% [Solved]


Recommended Posts

I really need help with Forge 1.16.4 in using gradlew genEclipseRun as it gets stuck at 88%, but the time continues. I have assigned about 2GBs to it and it does use that much, as well as all of my CPU usage, it is such a pig, XD. But it is stuck on 88%, even while using all of those resourced. I even left it for 7 Hours and no go, it is annoying and don't know what to do.

The main reason why I am trying to run it is for the Forge Source as I heard that creates it, I think anyways. Unless anyone know where to get the forge source at, please say. I have tried looking at this post in how but doesn't exactly answer my question, actually, I don't know if it does answer my question as it hinted to running the command.

Any help that leads to fixing the genEclipseRun command or help with getting the forge source in for attached docs to help with modding is very, very, very greatly appreciated. 

This has been solved. Click here to see what solved my problem.

Edited by jonathanpecany
My question has been solved. Reserve 3GBs of RAM for Java
Link to comment
Share on other sites

Posted (edited)
7 minutes ago, diesieben07 said:

Decompiling Minecraft needs at least 3GB of RAM.

Wait, 3 full Gbs, now I have to say that that might just restrict a lot of people from modding.

But I will try it, it might throw a heap error though.

Edited by jonathanpecany
Link to comment
Share on other sites

2 minutes ago, diesieben07 said:

Decompiling is hard, especially if you want at least half-decent code to come out of it.

Minecraft is a big codebase.

Ergo: Decompiling Minecraft takes a lot of memory.

Well, alright then. I'll report back with what will happen.

Also, what is the main purpose of gradlew genEclipseRun?

Link to comment
Share on other sites

Posted (edited)
17 minutes ago, diesieben07 said:

It generates the run configurations for eclipse so you can start the game.

If the game is not decompiled yet, it will do so.

Well, your suggestion works. My computer run 3GBs of it quite easy. Guess I underestimated my computer, lol.
Thanks again.

Now, how do I get the forge source?

Edited by jonathanpecany
Link to comment
Share on other sites

Posted (edited)
12 minutes ago, diesieben07 said:

It tells you how to set up a Forge modding workspace in Eclipse.

Well, yeah. I have already done all of that. I have it open in eclipse and there are no errors. Only problem is, it will be hard to mod without some sort of docs. I have attached source to Forge in the Referenced Libraries from the .gradle cache (caches\forge_gradle\minecraft_user_repo\net\minecraftforge\forge\1.16.4-35.1.4), I attached the decomp one. But problem is that there seems to be no comment docs inside any of them, making it harder to mod it.

 

I did all of this right after running gradlew genEclipseRuns from cmd within the folder. I also did gradlew eclipse before that. Now, it is both build successful, I open it in eclipse and looked in reference libraries and in Forge snapshot, noticed no attached source so I added one that I think was it, which I think it was as it was working.

And that was the full steps in what I did. I tried to be as specific as I can. I really want to mod Minecraft, but I don't want it to be a lot harder to find what it does exactly, that will take forever and I want to customize Minecraft to the full expense of my imagination.

Edited by jonathanpecany
Link to comment
Share on other sites

Minecraft is not open source. In fact it is not even visible source. All we get from Mojang is the compiled jar file, which obviously does not contain any comments. On top of that the code is also obfuscated. In very recent versions Forge has switched to using Mojang's official mappings by default, so at least now fields and methods will have the same name as in Mojang's code. However you still don't get parameter names or comments.

There is nothing you can do about this, although in theory you could ask Mojang for documentation... ;)

Link to comment
Share on other sites

1 minute ago, diesieben07 said:

Minecraft is not open source. In fact it is not even visible source. All we get from Mojang is the compiled jar file, which obviously does not contain any comments. On top of that the code is also obfuscated. In very recent versions Forge has switched to using Mojang's official mappings by default, so at least now fields and methods will have the same name as in Mojang's code. However you still don't get parameter names or comments.

There is nothing you can do about this, although in theory you could ask Mojang for documentation... ;)

So how does other madders that create awesome mods like GalacticCraft mod? I used GalacticCraft as an example as it uses a lot of neat features, like flag design, rocket, UI, Space UI, custom armor, adding tabs in Player Inventory, and more.

What steps did they take to look at how they do this and that? That is what confuses me, like if it doesn't have any sort of comments then how do people mod? That always confused me.

I could always ask Mojang for documentation, but why would they, lol. If it was that simple, I am about certain that if that was that easy, Forge would have access, but who knows though, they probably only asked once, so it might just work. Never hurts to ask, they can't sue you or anything for asking, lol. That would take away my first amendment of the USA.

Link to comment
Share on other sites

16 minutes ago, jonathanpecany said:

Really? That is way to much, to do that would take months. There has to be an easier way that doesn't make someone discourage.

you don't need to read ALL the code, just the parts that concern your needs

 

plus the forge docs has information on all the fundamentals that you need, such as registries, events, capabilities...

from there you kind of have to figure things out for yourself... by reading the minecraft source code, or other mods source codes

there are a lot of example mods out there aimed at helping begginers

this is one that helped me a lot: https://github.com/TheGreyGhost/MinecraftByExample

 

and if you can't figure out how to do something, you can always ask for help in the forum or in the discord

Edited by kiou.23
Link to comment
Share on other sites

7 minutes ago, kiou.23 said:

you don't need to read ALL the code, just the parts that concern your needs

 

plus the forge docs has information on all the fundamentals that you need, such as registries, events, capabilities...

from there you kind of have to figure things out for yourself... by reading the minecraft source code, or other mods source codes

there are a lot of example mods out there aimed at helping begginers

this is one that helped me a lot: https://github.com/TheGreyGhost/MinecraftByExample

 

and if you can't figure out how to do something, you can always ask for help in the forum or in the discord

Alright, thanks. I will do that. Still probably going to be a pain though, but I will. Can I add my own custom comments to the source, I really hope so. But I think I can do it.

Also, what is the proper forge source at, I seen that forge decomp didn't include every source?

Link to comment
Share on other sites

2 minutes ago, jonathanpecany said:

Alright, thanks. I will do that. Still probably going to be a pain though, but I will. Can I add my own custom comments to the source, I really hope so. But I think I can do it.

Also, what is the proper forge source at, I seen that forge decomp didn't include every source?

https://github.com/MinecraftForge/MinecraftForge/

Link to comment
Share on other sites

3 minutes ago, jonathanpecany said:

Alright, thanks. I will do that. Still probably going to be a pain though

it's not that bad, modding felt impossible when I started too, but the modularity that it has makes it much easier to handle

 

3 minutes ago, jonathanpecany said:

Can I add my own custom comments to the source, I really hope so. But I think I can do it.

nope, those classes are read-only, you can add comments to your own code tho

plus lots of the methods have javadocs too

Edited by kiou.23
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Thanks for the feedback. But it seems there is not really an easy way for this, most of the code is hard-coded and could not be accessed directly. 😞 I worked around this by using the "RenderHandEvent" and "RenderPlayerEvent" to create a dedicated render for my crossbow item.
    • I'm wondering how to go about creating a block that is essentially an Ender Chest (its contents are the same regardless of which chest you check), but where any player in that world can see the contents of the Ender Chest. I was thinking of modifying the saved data for a world, but I'm struggling to understand how that even works. Are there any tutorials out there on tools I can use to work on this sort of problem?  EDIT: I just found this post: is this about what I should be looking at for 1.16.5?    
    • Hey guys I have created a mod that assigns levels to mobs and scales them up using capabilities, everything works great but because of the recent changes to capabilities I am unable to find examples on how to save the level of my mobs so that it remains the same if I restart the server. I will upload all my files relating to the capability and hope you guys can lead me in the right direction   package com.chickenwand3.rpgmod.core.capabilities.entity; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.common.capabilities.CapabilityManager; @SuppressWarnings("removal") public class CapabilityMobLevel { @CapabilityInject(MobLevel.class) public static Capability<MobLevel> MOB_LEVEL_CAPABILITY = null; public static void register() { CapabilityManager.INSTANCE.register(MobLevel.class); } } package com.chickenwand3.rpgmod.core.capabilities.entity; public class DefaultMobLevel implements MobLevel { public int mobLevel; public float mobMaxHealth; public float mobCurrentHealth; public boolean crazy; public boolean isCrazy() { return crazy; } public float getMaxHealth() { return mobMaxHealth; } public float getCurrentHealth() { return mobCurrentHealth; } } package com.chickenwand3.rpgmod.core.capabilities.entity; public interface MobLevel { } package com.chickenwand3.rpgmod.core.capabilities.entity; import com.chickenwand3.rpgmod.RPGMod; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.Mob; import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraft.world.entity.monster.Zombie; import net.minecraft.world.item.enchantment.Enchantments; import net.minecraftforge.event.AttachCapabilitiesEvent; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = RPGMod.MODID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class MobLevelEventHandler { @SubscribeEvent public static void onAttachCapabilitiesEvent(AttachCapabilitiesEvent<Entity> event) { if (event.getObject() instanceof Mob && !event.getObject().getCommandSenderWorld().isClientSide) { MobLevelProvider providerMobLevel = new MobLevelProvider(); event.addCapability(new ResourceLocation(RPGMod.MODID, "moblevel"), providerMobLevel); event.addListener(providerMobLevel::invalidate); } } @SubscribeEvent public static void OnSpawn(final EntityJoinWorldEvent event) { if (event.getEntity()instanceof Mob target && !event.getWorld().isClientSide) { target.getCapability(CapabilityMobLevel.MOB_LEVEL_CAPABILITY).ifPresent(mobLevel -> { DefaultMobLevel actualMobLevel = (DefaultMobLevel) mobLevel; actualMobLevel.mobLevel = (randomizeMobLevel()); if (superCrazy(actualMobLevel.mobLevel)) { actualMobLevel.crazy = true; } if (actualMobLevel.crazy) { if (!target.getMainHandItem().isEmpty()) { target.getMainHandItem().enchant(Enchantments.FIRE_ASPECT, 1); } if (event.getEntity()instanceof Zombie zombie) { zombie.getAttribute(Attributes.SPAWN_REINFORCEMENTS_CHANCE).setBaseValue(0.99D); } System.out.println("Super Crazy " + target.getName() + " has spawned!"); } actualMobLevel.mobMaxHealth = (target.getMaxHealth() * actualMobLevel.mobLevel * 2); actualMobLevel.mobCurrentHealth = actualMobLevel.mobMaxHealth; target.getAttribute(Attributes.MOVEMENT_SPEED) .setBaseValue(target.getAttributeValue(Attributes.MOVEMENT_SPEED) * (1 + (actualMobLevel.mobLevel - 1.0) / 10.0)); if (target.getAttribute(Attributes.ATTACK_DAMAGE) != null) { target.getAttribute(Attributes.ATTACK_DAMAGE) .setBaseValue(target.getAttributeValue(Attributes.ATTACK_DAMAGE) * (1 + (actualMobLevel.mobLevel - 1.0) / 2.0)); } }); } } private static int randomizeMobLevel() { boolean roll = true; int level = 1; while (roll) { if (Math.random() > .5) { level += 1; roll = true; } else { roll = false; } } return level; } private static boolean superCrazy(int level) { boolean result = false; if (level >= 5) { if (Math.random() < .25) { result = true; } else result = false; } return result; } } package com.chickenwand3.rpgmod.core.capabilities.entity; import net.minecraft.core.Direction; import net.minecraft.nbt.CompoundTag; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.ICapabilitySerializable; import net.minecraftforge.common.util.LazyOptional; import javax.annotation.Nonnull; import javax.annotation.Nullable; public class MobLevelProvider implements ICapabilitySerializable<CompoundTag> { private final DefaultMobLevel mobLevel = new DefaultMobLevel(); private final LazyOptional<MobLevel> mobLevelOptional = LazyOptional.of(() -> mobLevel); public void invalidate() { mobLevelOptional.invalidate(); } @Nonnull @Override public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { return mobLevelOptional.cast(); } @Override public CompoundTag serializeNBT() { if (CapabilityMobLevel.MOB_LEVEL_CAPABILITY == null) { return new CompoundTag(); } else { CompoundTag compoundNBT = new CompoundTag(); compoundNBT.putInt("mobLevel", mobLevel.mobLevel); compoundNBT.putFloat("mobCurrentHealth", mobLevel.mobCurrentHealth); compoundNBT.putFloat("mobMaxHealth", mobLevel.mobMaxHealth); compoundNBT.putBoolean("crazy", mobLevel.crazy); return compoundNBT; } } @Override public void deserializeNBT(CompoundTag nbt) { if (CapabilityMobLevel.MOB_LEVEL_CAPABILITY != null) { mobLevel.mobLevel = (nbt.getInt("mobLevel")); float mobCurrentHealth = nbt.getFloat("mobCurrentHealth"); mobLevel.mobCurrentHealth = (mobCurrentHealth); float mobMaxHealth = nbt.getFloat("mobMaxHealth"); mobLevel.mobMaxHealth = (mobMaxHealth); boolean crazy = nbt.getBoolean("crazy"); mobLevel.crazy = (crazy); } } }  
    • Trying to install forge on Debian 11 (bullseye). I ran java -jar forge-1.18-38.0.4-installer.jar in the terminal, and that part seemed to work fine. I did the install client, and it was fine until the building processors step. It stopped and gave the following error message: Failed to run processor: java.lang.RuntimeException:Could not delete output file: home/[user]/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255-mappings.txt My dad did the same thing on his computer without complications. Any help would be much appreciated. Below is the installation log: JVM info: Debian - 17.0.1 - 17.0.1+12-Debian-1deb11u2 java.net.preferIPv4Stack=true Found java version 17.0.1 Extracting json Considering minecraft client jar Downloading libraries Found 0 additional library directories Considering library cpw.mods:securejarhandler:0.9.54 File exists: Checksum validated. Considering library org.ow2.asm:asm:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-commons:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-tree:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-util:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-analysis:9.1 File exists: Checksum validated. Considering library net.minecraftforge:accesstransformers:8.0.4 File exists: Checksum validated. Considering library org.antlr:antlr4-runtime:4.9.1 File exists: Checksum validated. Considering library net.minecraftforge:eventbus:5.0.3 File exists: Checksum validated. Considering library net.minecraftforge:forgespi:4.0.10 File exists: Checksum validated. Considering library net.minecraftforge:coremods:5.0.1 File exists: Checksum validated. Considering library cpw.mods:modlauncher:9.0.7 File exists: Checksum validated. Considering library net.minecraftforge:unsafe:0.2.0 File exists: Checksum validated. Considering library com.electronwill.night-config:core:3.6.4 File exists: Checksum validated. Considering library com.electronwill.night-config:toml:3.6.4 File exists: Checksum validated. Considering library org.apache.maven:maven-artifact:3.6.3 File exists: Checksum validated. Considering library org.apache.commons:commons-lang3:3.12.0 File exists: Checksum validated. Considering library net.jodah:typetools:0.8.3 File exists: Checksum validated. Considering library org.apache.logging.log4j:log4j-api:2.14.1 File exists: Checksum validated. Considering library org.apache.logging.log4j:log4j-core:2.14.1 File exists: Checksum validated. Considering library net.minecrell:terminalconsoleappender:1.2.0 File exists: Checksum validated. Considering library org.jline:jline-reader:3.12.1 File exists: Checksum validated. Considering library org.jline:jline-terminal:3.12.1 File exists: Checksum validated. Considering library net.sf.jopt-simple:jopt-simple:5.0.4 File exists: Checksum validated. Considering library org.openjdk.nashorn:nashorn-core:15.3 File exists: Checksum validated. Considering library com.google.guava:guava:31.0.1-jre File exists: Checksum validated. Considering library com.google.code.gson:gson:2.8.8 File exists: Checksum validated. Considering library cpw.mods:bootstraplauncher:0.1.17 File exists: Checksum validated. Considering library net.minecraftforge:fmlloader:1.18-38.0.4 File exists: Checksum validated. Considering library com.github.jponge:lzma-java:1.3 File exists: Checksum validated. Considering library com.google.code.findbugs:jsr305:3.0.2 File exists: Checksum validated. Considering library com.google.code.gson:gson:2.8.7 File exists: Checksum validated. Considering library com.google.errorprone:error_prone_annotations:2.1.3 File exists: Checksum validated. Considering library com.google.guava:guava:20.0 File exists: Checksum validated. Considering library com.google.guava:guava:25.1-jre File exists: Checksum validated. Considering library com.google.j2objc:j2objc-annotations:1.1 File exists: Checksum validated. Considering library com.nothome:javaxdelta:2.0.1 File exists: Checksum validated. Considering library com.opencsv:opencsv:4.4 File exists: Checksum validated. Considering library commons-beanutils:commons-beanutils:1.9.3 File exists: Checksum validated. Considering library commons-collections:commons-collections:3.2.2 File exists: Checksum validated. Considering library commons-io:commons-io:2.4 File exists: Checksum validated. Considering library commons-logging:commons-logging:1.2 File exists: Checksum validated. Considering library de.oceanlabs.mcp:mcp_config:1.18-20211130.085255@zip File exists: Checksum validated. Considering library de.siegmar:fastcsv:2.0.0 File exists: Checksum validated. Considering library net.md-5:SpecialSource:1.10.0 File exists: Checksum validated. Considering library net.minecraftforge:ForgeAutoRenamingTool:0.1.17:all File exists: Checksum validated. Considering library net.minecraftforge:binarypatcher:1.0.12 File exists: Checksum validated. Considering library net.minecraftforge:fmlcore:1.18-38.0.4 File exists: Checksum validated. Considering library net.minecraftforge:fmlloader:1.18-38.0.4 File exists: Checksum validated. Considering library net.minecraftforge:forge:1.18-38.0.4:universal File exists: Checksum validated. Considering library net.minecraftforge:installertools:1.2.10 File exists: Checksum validated. Considering library net.minecraftforge:jarsplitter:1.1.4 File exists: Checksum validated. Considering library net.minecraftforge:javafmllanguage:1.18-38.0.4 File exists: Checksum validated. Considering library net.minecraftforge:mclanguage:1.18-38.0.4 File exists: Checksum validated. Considering library net.minecraftforge:srgutils:0.4.3 File exists: Checksum validated. Considering library net.minecraftforge:srgutils:0.4.7 File exists: Checksum validated. Considering library net.sf.jopt-simple:jopt-simple:5.0.4 File exists: Checksum validated. Considering library net.sf.jopt-simple:jopt-simple:6.0-alpha-3 File exists: Checksum validated. Considering library org.apache.commons:commons-collections4:4.2 File exists: Checksum validated. Considering library org.apache.commons:commons-lang3:3.8.1 File exists: Checksum validated. Considering library org.apache.commons:commons-text:1.3 File exists: Checksum validated. Considering library org.checkerframework:checker-qual:2.0.0 File exists: Checksum validated. Considering library org.codehaus.mojo:animal-sniffer-annotations:1.14 File exists: Checksum validated. Considering library org.ow2.asm:asm-analysis:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-analysis:9.2 File exists: Checksum validated. Considering library org.ow2.asm:asm-commons:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-commons:9.2 File exists: Checksum validated. Considering library org.ow2.asm:asm-tree:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm-tree:9.2 File exists: Checksum validated. Considering library org.ow2.asm:asm:9.1 File exists: Checksum validated. Considering library org.ow2.asm:asm:9.2 File exists: Checksum validated. Considering library trove:trove:1.0.2 File exists: Checksum validated. Created Temporary Directory: /tmp/forge_installer10859551180063758840 Extracting: /data/client.lzma Building Processors =============================================================================== MainClass: net.minecraftforge.installertools.ConsoleTool Classpath: /home/qila/.minecraft/libraries/net/minecraftforge/installertools/1.2.10/installertools-1.2.10.jar /home/qila/.minecraft/libraries/net/md-5/SpecialSource/1.10.0/SpecialSource-1.10.0.jar /home/qila/.minecraft/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar /home/qila/.minecraft/libraries/com/google/code/gson/gson/2.8.7/gson-2.8.7.jar /home/qila/.minecraft/libraries/de/siegmar/fastcsv/2.0.0/fastcsv-2.0.0.jar /home/qila/.minecraft/libraries/net/minecraftforge/srgutils/0.4.3/srgutils-0.4.3.jar /home/qila/.minecraft/libraries/org/ow2/asm/asm-commons/9.1/asm-commons-9.1.jar /home/qila/.minecraft/libraries/com/google/guava/guava/20.0/guava-20.0.jar /home/qila/.minecraft/libraries/com/opencsv/opencsv/4.4/opencsv-4.4.jar /home/qila/.minecraft/libraries/org/ow2/asm/asm-analysis/9.1/asm-analysis-9.1.jar /home/qila/.minecraft/libraries/org/ow2/asm/asm-tree/9.1/asm-tree-9.1.jar /home/qila/.minecraft/libraries/org/ow2/asm/asm/9.1/asm-9.1.jar /home/qila/.minecraft/libraries/org/apache/commons/commons-text/1.3/commons-text-1.3.jar /home/qila/.minecraft/libraries/org/apache/commons/commons-lang3/3.8.1/commons-lang3-3.8.1.jar /home/qila/.minecraft/libraries/commons-beanutils/commons-beanutils/1.9.3/commons-beanutils-1.9.3.jar /home/qila/.minecraft/libraries/org/apache/commons/commons-collections4/4.2/commons-collections4-4.2.jar /home/qila/.minecraft/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar /home/qila/.minecraft/libraries/commons-collections/commons-collections/3.2.2/commons-collections-3.2.2.jar Args: --task, MCP_DATA, --input, /home/qila/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255.zip, --output, /home/qila/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255-mappings.txt, --key, mappings Task: MCP_DATA Input: /home/qila/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255.zip Output: /home/qila/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255-mappings.txt Key: mappings Could not delete output file: /home/qila/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255-mappings.txt java.lang.RuntimeException: Could not delete output file: /home/qila/.minecraft/libraries/de/oceanlabs/mcp/mcp_config/1.18-20211130.085255/mcp_config-1.18-20211130.085255-mappings.txt at net.minecraftforge.installertools.Task.error(Task.java:28) at net.minecraftforge.installertools.McpData.process(McpData.java:63) at net.minecraftforge.installertools.ConsoleTool.main(ConsoleTool.java:55) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:568) at net.minecraftforge.installer.actions.PostProcessors.process(PostProcessors.java:226) at net.minecraftforge.installer.actions.ClientInstall.run(ClientInstall.java:144) at net.minecraftforge.installer.InstallerPanel.run(InstallerPanel.java:423) at net.minecraftforge.installer.SimpleInstaller.launchGui(SimpleInstaller.java:175) at net.minecraftforge.installer.SimpleInstaller.main(SimpleInstaller.java:147)  
    • @RideableEntitiesModElements.ModElement.Tag public class BabytigerEntity extends RideableEntitiesModElements.ModElement { public static EntityType entity = (EntityType.Builder.<CustomEntity>create(CustomEntity::new, EntityClassification.MONSTER) .setShouldReceiveVelocityUpdates(true).setTrackingRange(64).setUpdateInterval(3).setCustomClientFactory(CustomEntity::new) .size(0.6f, 1.8f)).build("babytiger").setRegistryName("babytiger"); public BabytigerEntity(RideableEntitiesModElements instance) { super(instance, 4); FMLJavaModLoadingContext.get().getModEventBus().register(new BabytigerRenderer.ModelRegisterHandler()); FMLJavaModLoadingContext.get().getModEventBus().register(new EntityAttributesRegisterHandler()); MinecraftForge.EVENT_BUS.register(this); } @Override public void initElements() { elements.entities.add(() -> entity); elements.items .add(() -> new SpawnEggItem(entity, -1, -1, new Item.Properties().group(ItemGroup.MISC)).setRegistryName("babytiger_spawn_egg")); } @SubscribeEvent public void addFeatureToBiomes(BiomeLoadingEvent event) { event.getSpawns().getSpawner(EntityClassification.MONSTER).add(new MobSpawnInfo.Spawners(entity, 20, 4, 4)); } @Override public void init(FMLCommonSetupEvent event) { EntitySpawnPlacementRegistry.register(entity, EntitySpawnPlacementRegistry.PlacementType.ON_GROUND, Heightmap.Type.MOTION_BLOCKING_NO_LEAVES, MonsterEntity::canMonsterSpawn); } private static class EntityAttributesRegisterHandler { @SubscribeEvent public void onEntityAttributeCreation(EntityAttributeCreationEvent event) { AttributeModifierMap.MutableAttribute ammma = MobEntity.func_233666_p_(); ammma = ammma.createMutableAttribute(Attributes.MOVEMENT_SPEED, 0.8); ammma = ammma.createMutableAttribute(Attributes.MAX_HEALTH, 10); ammma = ammma.createMutableAttribute(Attributes.ARMOR, 0); ammma = ammma.createMutableAttribute(Attributes.ATTACK_DAMAGE, 3); event.put(entity, ammma.create()); } } public static class CustomEntity extends CreatureEntity { public CustomEntity(FMLPlayMessages.SpawnEntity packet, World world) { this(entity, world); } public CustomEntity(EntityType<CustomEntity> type, World world) { super(type, world); experienceValue = 0; setNoAI(false); } @Override public IPacket<?> createSpawnPacket() { return NetworkHooks.getEntitySpawningPacket(this); } @Override protected void registerGoals() { super.registerGoals(); this.goalSelector.addGoal(1, new MeleeAttackGoal(this, 1.2, false)); this.goalSelector.addGoal(2, new RandomWalkingGoal(this, 1)); this.targetSelector.addGoal(3, new HurtByTargetGoal(this)); this.goalSelector.addGoal(4, new LookRandomlyGoal(this)); this.goalSelector.addGoal(5, new SwimGoal(this)); } @Override public CreatureAttribute getCreatureAttribute() { return CreatureAttribute.UNDEFINED; } @Override public net.minecraft.util.SoundEvent getHurtSound(DamageSource ds) { return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.hurt")); } @Override public net.minecraft.util.SoundEvent getDeathSound() { return (net.minecraft.util.SoundEvent) ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("entity.generic.death")); } @Override public ActionResultType func_230254_b_(PlayerEntity sourceentity, Hand hand) { ItemStack itemstack = sourceentity.getHeldItem(hand); ActionResultType retval = ActionResultType.func_233537_a_(this.world.isRemote()); super.func_230254_b_(sourceentity, hand); sourceentity.startRiding(this); return retval; } @Override public void travel(Vector3d dir) { Entity entity = this.getPassengers().isEmpty() ? null : (Entity) this.getPassengers().get(0); if (this.isBeingRidden()) { this.rotationYaw = entity.rotationYaw; this.prevRotationYaw = this.rotationYaw; this.rotationPitch = entity.rotationPitch * 0.5F; this.setRotation(this.rotationYaw, this.rotationPitch); this.jumpMovementFactor = this.getAIMoveSpeed() * 0.15F; this.renderYawOffset = entity.rotationYaw; this.rotationYawHead = entity.rotationYaw; this.stepHeight = 1.0F; if (entity instanceof LivingEntity) { this.setAIMoveSpeed((float) this.getAttributeValue(Attributes.MOVEMENT_SPEED)); float forward = ((LivingEntity) entity).moveForward; float strafe = ((LivingEntity) entity).moveStrafing; super.travel(new Vector3d(strafe, 0, forward)); } this.prevLimbSwingAmount = this.limbSwingAmount; double d1 = this.getPosX() - this.prevPosX; double d0 = this.getPosZ() - this.prevPosZ; float f1 = MathHelper.sqrt(d1 * d1 + d0 * d0) * 4.0F; if (f1 > 1.0F) f1 = 1.0F; this.limbSwingAmount += (f1 - this.limbSwingAmount) * 0.4F; this.limbSwing += this.limbSwingAmount; return; } this.stepHeight = 0.5F; this.jumpMovementFactor = 0.02F; super.travel(dir); } } } ok thanks and for the people that want to copy paste here is the code
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.