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

Antonii

Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by Antonii

  1. Yes finally. I took some suggestions from here The libraries are now embedded and loaded on runtime. I used embed and works perfectly. This is the final configuration: buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true } } apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' apply plugin: 'maven-publish' version = '1.0' group = 'com.lumieresombre.horizonprivatemodid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = 'modid' java.toolchain.languageVersion = JavaLanguageVersion.of(11) // Mojang ships Java 8 to end users, so your mod should target Java 8. println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch')) minecraft { // The mappings can be changed at any time, and must be in the following format. // Channel: Version: // snapshot YYYYMMDD Snapshot are built nightly. // stable # Stables are built at the discretion of the MCP team. // official MCVersion Official field/method names from Mojang mapping files // // You must be aware of the Mojang license when using the 'official' mappings. // See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md // // Use non-default mappings at your own risk. they may not always work. // Simply re-run your setup task after changing the mappings to update your workspace. mappings channel: 'official', version: '1.16.5' // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. runs { client { workingDirectory project.file('run') // Recommended logging data for a userdev environment // The markers can be changed as needed. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { horizonprivatemodid{ source sourceSets.main } } } server { workingDirectory project.file('run') // Recommended logging data for a userdev environment // The markers can be changed as needed. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' mods { examplemod { source sourceSets.main } } } data { workingDirectory project.file('run') // Recommended logging data for a userdev environment // The markers can be changed as needed. // "SCAN": For mods scan. // "REGISTRIES": For firing of registry events. // "REGISTRYDUMP": For getting the contents of all registries. property 'forge.logging.markers', 'REGISTRIES' // Recommended logging level for the console // You can set various levels here. // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels property 'forge.logging.console.level', 'debug' // Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources. args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/') mods { horizonprivatemodid{ source sourceSets.main } } } } } repositories { mavenLocal() mavenCentral() flatDir { dirs 'libs\\' } } // Include resources generated by data generators. sourceSets.main.resources { srcDir 'src/generated/resources' } configurations { embed } dependencies { // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. // The userdev artifact is a special name and will get all sorts of transformations applied to it. minecraft 'net.minecraftforge:forge:1.16.5-36.1.24' // You may put jars on which you depend on in ./libs or you may define them like so.. // compile "some.group:artifact:version:classifier" // compile "some.group:artifact:version" //compile files("libs/automaton.jar","libs/xeger-1.0-SNAPSHOT.jar") compile "com.lumieresombre.lib:xeger:1.0.0" compile "com.lumieresombre.lib:automaton:1.0.0" embed "com.lumieresombre.lib:xeger:1.0.0" embed "com.lumieresombre.lib:automaton:1.0.0" // Real examples // compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env // compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. // provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // These dependencies get remapped to your current MCP mappings // deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev' // For more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } // Example for how to get properties into the manifest for reading by the runtime.. jar { manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "ContainedDeps":"automaton-1.0.0.jar xeger-1.0.0.jar", "Class-Path":"automaton-1.0.0.jar xeger-1.0.0.jar" ]) } from configurations.embed.collect { it.isDirectory() ? it : zipTree(it) } } // Example configuration to allow publishing using the maven-publish task // This is the preferred method to reobfuscate your jar file jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing //publish.dependsOn('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } }
  2. I have tried all imaginable configurations in order to load an external jar to my mod. Forge version: 1.16 IDE: IntelliJ Java: 11.0.11 for building and running On 1.12 version I used to simply add the jars to the build.gradle with the `compile files()` command and then add them to the mods folder together with the mod jar. It used to work. But now it seems it cannot find the jars anymore. I'll post the logs at the end. Even more I scanned for IO access from the java (procmon) and I can't see it trying to read any file when the function containing the external reference is called (I suppose it loads the jar on request). I admit I am confused about all the maven and "libraries" vs "libs" features. I noticed that everything in META-INF in src/main/resources is automatically included in the final jar. But if this is supposed to happen what's with all the maven? Isn't maven supposed to automatically download jars from some public repository/local repo when needed? Why bundle it in the jar and then require the special .meta files just to make it work? Here's what I tried for the build.gradle. I tried many different configurations but the uncommented one is aproximatelly what worked in the past. buildscript { repositories { maven { url = 'https://maven.minecraftforge.net' } mavenCentral() } dependencies { classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true } } repositories { mavenLocal() mavenCentral() flatDir { dirs 'C:\\MinecraftForge\\Forge1.16\\src\\main\\resources\\META-INF\\libraries' } } configurations { inJar } configurations.compile.extendsFrom(configurations.inJar) dependencies { // Old fashioned way that worked before compile files("libs/automaton.jar","libs/xeger.jar") // Tried the maven public repository - I am afraid that this old library could actually contain malware // implementation group: 'nl.flotsam', name: 'xeger', version: '1.0.0-lorislab-1' // Seen this on another forum - adding the jars to the maven with the .maven file and including for the local repo //inJar 'com.lumieresombre.lib:xeger:1.0.0' //inJar 'com.lumieresombre.lib:automaton:1.0.0' // Something else I tried. Didn't work. Could // compile "com.lumieresombre.lib:xeger:1.0.0" // compile "com.lumieresombre.lib:automaton:1.0.0" } // Example for how to get properties into the manifest for reading by the runtime.. jar { from(configurations.inJar) { into 'META-INF/libraries' } manifest { attributes([ "Specification-Title": "examplemod", "Specification-Vendor": "examplemodsareus", "Specification-Version": "1", // We are version 1 of ourselves "Implementation-Title": project.name, "Implementation-Version": "${version}", "Implementation-Vendor" :"examplemodsareus", "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), "ContainedDeps":"automaton-1.0.0.jar xeger-1.0.0.jar" ]) } } // Example configuration to allow publishing using the maven-publish task // This is the preferred method to reobfuscate your jar file jar.finalizedBy('reobfJar') // However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing //publish.dependsOn('reobfJar') publishing { publications { mavenJava(MavenPublication) { artifact jar } } repositories { maven { url "file:///${project.projectDir}/mcmodsrepo" } } } I read here about inserting all the jars in the libraries folder and that the mod loader will take care of everything. I am not sure if it still exists in the 1.16 The mod jar did get large but gave the same error. Then I read about moving the libs to maven. I tried this variant using a local repo aka flatDir. Here you can see my confusion: I pointed the flatDirs to the libraries folder which already contained the needed .meta files. This gave the same result. Then I read that I can specify the dependencies in the jar classpath/manifest. I am not sure if I should have copied the file to the final jar path or if it was included in the file. What should I do? I just want to drop the jars near the mod file and make it work. The error log: https://pastebin.com/KJF37fZ6 And here's the code around the line of the crash: protected void init() { // Create the options row list // It must be created in this method instead of in the constructor, // or it will not be displayed properly this.optionsRowList = new OptionsRowList( this.minecraft, this.width, this.height, OPTIONS_LIST_TOP_HEIGHT, this.height - OPTIONS_LIST_BOTTOM_OFFSET, OPTIONS_LIST_ITEM_HEIGHT ); // Add the options row list as this screen's child // If this is not done, users cannot click on items in the list this.children.add(this.optionsRowList); IteratableOption usernameChanger=new IteratableOption( "hbwhelper.configGui.dreamMode.title", (unused, newValue) -> { Xeger generator = new Xeger(GeneralConfig.get().username_generator); String result = generator.generate(); Main.ReflectionChangeUsername(result); }, (unused, option) -> new StringTextComponent("Username: "+Minecraft.getInstance().getUser().getName()) ); SliderPercentageOption attackProbability=new SliderPercentageOption( "Attack Probability", // Range: 0 to width of game window 0.0, 100, // Steps 0.5F, // Getter and setter are similar to those in BooleanOption unused -> GeneralConfig.get().constants.hit_probability, (unused, newValue) -> GeneralConfig.get().constants.hit_probability=newValue, // BiFunction that returns a string text component // in format "<name>: <value>" (gs, option) -> new StringTextComponent("Probability: "+GeneralConfig.get().constants.hit_probability) ); this.optionsRowList.addBig(usernameChanger); this.optionsRowList.addBig(attackProbability); // Add the "Done" button this.addButton(new Button( (this.width - BUTTON_WIDTH) / 2, this.height - DONE_BUTTON_TOP_OFFSET, BUTTON_WIDTH, BUTTON_HEIGHT, // Text shown on the button new TranslationTextComponent("gui.done"), // Action performed when the button is pressed button -> this.onClose() )); }
  3. How can I register local commands for a logical client side-only mod? I want to access these commands when for example playing on a server. However it seems the commands are first searched on the server and of course it fails when none is found. i can see a part of the commands logic in CommandSuggestionHelper::updateCommandInfo(). This is called when I input a string in the command and seems to generate the suggestions by making a request to the server. And ChatScreen::keyPressed() calls sendMessage() which contains a comment It looks like it might not be yet implemented. So is this possible? I am using version 1.16.5 - 36.1.0. What I've tried (taken from MinecraftByExample) public class TestCommand { public static void register(CommandDispatcher<CommandSource> dispatcher) { LiteralArgumentBuilder<CommandSource> mbequoteCommand = Commands.literal("mbequote") .then(Commands.literal("python") .executes(commandContext -> sendMessage(commandContext, QuoteSource.MONTY_PYTHON.getQuote()))) .then(Commands.literal("blues") .executes(commandContext -> sendMessage(commandContext, QuoteSource.BLUES_BROTHERS.getQuote()))) .then(Commands.literal("yogi") .then(Commands.literal("bear").executes( commandContext -> sendMessage(commandContext, QuoteSource.YOGI_BEAR.getQuote()))) .then(Commands.literal("miaow").executes( commandContext -> sendMessage(commandContext, QuoteSource.YOGI_BERRA.getQuote()))) .executes(commandContext -> sendMessage(commandContext, "Which Yogi do you mean?")) ); dispatcher.register(mbequoteCommand); } static int sendMessage(CommandContext<CommandSource> commandContext, String message) throws CommandSyntaxException { TranslationTextComponent finalText = new TranslationTextComponent("chat.type.announcement", commandContext.getSource().getDisplayName(), new StringTextComponent(message)); Entity entity = commandContext.getSource().getEntity(); if (entity != null) { commandContext.getSource().getServer().getPlayerList().broadcastMessage(finalText, ChatType.CHAT, entity.getUUID()); // func_232641_a_ is sendMessage() } else { commandContext.getSource().getServer().getPlayerList().broadcastMessage(finalText, ChatType.SYSTEM, Util.NIL_UUID); } return 1; } enum QuoteSource { MONTY_PYTHON(new String[] { "Nobody expects the Spanish Inquisition!", "What sad times are these when passing ruffians can say 'Ni' at will to old ladies.", "That's the machine that goes 'ping'.", "Have you got anything without spam?", "We interrupt this program to annoy you and make things generally more irritating.", "My brain hurts!" }), YOGI_BERRA(new String[] { "When you come to a fork in the road... take it.", "It ain't over till it's over.", "The future ain't what it used to be.", "If the world was perfect, it wouldn't be." }), YOGI_BEAR(new String[] { "I'm smarter than the average bear." }), BLUES_BROTHERS(new String[] { "Four fried chickens and a Coke, please.", "It's 106 miles to Chicago, we've got a full tank, half pack of cigarettes, it's dark out, and we're wearing sunglasses. Hit it.", "Are you the police? No ma'am, we're musicians." }); public String getQuote() { return quotes[new Random().nextInt(quotes.length)]; } QuoteSource(String[] quotes) { this.quotes = quotes; } private String[] quotes; } } This command works on local multiplayer environment but not when connected to a dedicated/external server (meaning the server gets the request and replies with command not found)
  4. This is exactly what I thought! Thanks. This is why I said So the issue at hand is to differentiate between the two...when? On events? I recall that some events where called on both sides. You must put this in the docs perhaps on the Sided page
  5. I admit I left one thing out: I will want to play a normal game locally. When I will do that won't my mod be loaded also on the logical server? It's true that in normal conditions the check is somewhat useless but just sometimes I don't want to load it when playing a singleplayer game. Also I will test my mod locally on a singleplayer world and that will have the same issues. I used to have some sort of check in my mod in 1.12 version that did this.
  6. Now now there is no need for irony or insults. I am just asking for help. Redirecting me to a page I already read doesn't help, does it? Now here is what I understood: So I must "protect" my code from all forms of server. Taking into consideration that this mod will only run on my PC and not on a physical server that leaves me with the following problem: how to differentiate between the logical server and logical client. The method isClientSide() seems appropriate but it is not available where I need it (perhaps at a later stage?) Let's say I do what you keep insisting I should do; I use DistExecutor for Dist.CLIENT and....I don't know if the mod is loaded on logical server or logical client. And this is because
  7. public Main() { DistExecutor.safeRunWhenOn(Dist.CLIENT,()->SomeClass::Init); } //SomeClass::Init contains register code This bad/not needed - my mod will never run on physical server public Main() { if (Minecraft.getInstance() == null || !Minecraft.getInstance().level.isClientSide()) return; FMLJavaModLoadingContext.get().getModEventBus().addListener(this::Init); } This good but doesn't work because `level` is null
  8. Yes indeed logical side is better and exactly what I want to do! Now how do I do that? isClientSide() doesn't work....because `level` is null
  9. Well you see DistExecutor is for the physical side. My mod will never run on a server but only on the client side. I only need to set apart the logical server and the logical client.
  10. I want my mod to only load when running on the logical client side. The problem is that on initial setup `Minecraft.getInstance().level` is null and so I cannot tell the sides apart. Is there any other clean way of doing this or should I use the `Thread.currentThread()` method?
  11. The docs say to use "isRemote()" to get the logical side but I can't find it in the `Minecraft.getInstance().level` world object. However I found `isClientSide()`. Is this method the counterpart of `isRemote`? Or was this functionality stripped away in favor of Dist?
  12. Never mind, I found it. Seems Eclipse is buggy again.
  13. Thanks. Do you also know the current way of taking a player's direction (north, south etc)? I used to call EnumFacing efc = player.getHorizontalFacing().getOpposite(); but the enum does not exist anymore and so the methods. I found what seems to be the replacement Directions but I could not find how it is used in the Entity class (a quick reference-search didn't return much)
  14. My mod will be client-side only and running on the 1.16 version of Forge. I want to know what's the difference between getPosition(), xo, xBob, xo, xOld? I think xOld stores the last position of the player before being updated by the server (or perhaps before taking a step?) but what about the others? I used to take the position of the player directly by accessing posX, posY and posZ. This was on the 1.12 version. Now I am not sure if I can simply replace all those with xo, yo and zo. That would make my job much easier.
  15. I managed to create a functional button for my gui in forge 1.12. Using annotations I created my config and then in my Gui I called the super(....,MyModConfig.class). I see that many things changed in 1.15. Is this still possible? I know I can manually create the text fields in the Gui and manually updating the config but I really want to use the annotations system. In the same time, this method already generates the Gui and I need a button to be created. I don't have any code to show because I am working on other parts of my code in this 'exporting-to-15' project. I will try to do some tests myself but first I want to know if it's worth it. Question #2 In the current version, in the button event, I access the textfileds generated by the config by reflection. This is nasty. Is there any other way to access the edited text without first clicking 'Done'? Question #3 Where did posY, posX and posZ disappear? The only available candidates that remotely resemble what used to be the current location of the player are the lastTickX fields. Note: this is a fully client-sided mod. I use forge 1.15.2
  16. What I ask is this: I have an origin and a target. I know the distance and the angle I need to get there. I don't know by what amount I move in a direction because it depends on the blocks beneath me. I know that I have arrived at the destination when dist<0.25 units. If I press in the same time left and forawrd I will go on 45deg angle. Let's say the angle is 15. How many times should I press left /forward so that I don't get away too much from the original planned path. It looks very similar to PWM (pulse width modulation)
  17. I am making a robot mod. The problem I have is that the code I created makes the player look only in one direction: the one in which he walks. I want to allow the yaw rotation to be manually controlled while maintaining the same walking direction. Here's my code: if(Main.pathToFollow.size()>0) { //Main.pathToFollow is an list of lists-every path is a list of nodes and I will have multiple paths to follow; ArrayList<PathPoint> path=Main.pathToFollow.get(0); PathPoint nextPos=path.get(0); double dx,dy,dz; double dist; dx=nextPos.x-player.posX+0.5D; dy=nextPos.y-player.posY; dz=nextPos.z-player.posZ+0.5D; dist=Math.sqrt(dx*dx+dy*dy+dz*dz); //Check if we were moved or something interfered with us and give control back to user if(prev_dist!=-1 && dist>prev_dist+2) { prev_dist=-1; Main.cancelAllMovement(); return; }else prev_dist=dist; if(dist>2) { if(!player.isSprinting()) player.setSprinting(true); }else if(!player.isSprinting()) player.setSprinting(false);//if close to destination shutdown sprinting or we'll miss it if(dist<=0.25D) { // is within targeted block //get the next one path.remove(0); prev_dist=-1; if(path.size()==0) { move.setForward=0;//if there's another path to follow after this one don't stop..."smooth" walking Main.pathToFollow.remove(0); } }else { // Face next block float f = (float)(MathHelper.atan2(dz, dx) * (180D / Math.PI)) -90.0f; player.rotationYaw = Main.updateRotation(player.rotationYaw, f, 179.0f); //double side_amount=Math.cos(Math.toRadians(f))*1; //1 is amount=1 block //double forward_amount=-Math.sin(Math.toRadians(f))*1; //if side_amount>0.21 then setSide ....<- is this correct? I hate the 0.21 constant move.setForward=1; // It's easier to just walk straight ...I don't have to know the typical walking distance when a genuine keypressed event is fired. The amount depends and the ground material : ~0.21 if(dy>0) player.jump(); } } I know that a player moves about 0.21(lowest I have seen) units when a key is pressed. But from the code it looks it depends on the ground material. If I delete the player.rotationYaw code how should I set the left/right/forward/bacwards amount? Here's the new movement class that deals with keyboard input: it contains the setForward/setJump and setSide: if (this.gameSettings.keyBindForward.isKeyDown() || setForward==1) { ++this.moveForward; this.forwardKeyDown = true; } else { this.forwardKeyDown = false; } if (this.gameSettings.keyBindBack.isKeyDown() || setForward==-1) { --this.moveForward; this.backKeyDown = true; } else { this.backKeyDown = false; } if (this.gameSettings.keyBindLeft.isKeyDown() || setSides==-1) { ++this.moveStrafe; this.leftKeyDown = true; } else { this.leftKeyDown = false; } if (this.gameSettings.keyBindRight.isKeyDown() || setSides==1) { --this.moveStrafe; this.rightKeyDown = true; } else { this.rightKeyDown = false; } So for controlling walking path I can only set setForward /setSides to +-1. A solution?
  18. I think I got it...the moveforward was resetted: public void updatePlayerMoveState() { this.moveStrafe = 0.0F; this.moveForward = 0.0F; if (this.gameSettings.keyBindForward.isKeyDown()) { ++this.moveForward; this.forwardKeyDown = true; } else { this.forwardKeyDown = false; } if (this.gameSettings.keyBindBack.isKeyDown()) { --this.moveForward; this.backKeyDown = true; } else { this.backKeyDown = false; } if (this.gameSettings.keyBindLeft.isKeyDown()) { ++this.moveStrafe; this.leftKeyDown = true; } else { this.leftKeyDown = false; } if (this.gameSettings.keyBindRight.isKeyDown()) { --this.moveStrafe; this.rightKeyDown = true; } else { this.rightKeyDown = false; } this.jump = this.gameSettings.keyBindJump.isKeyDown(); this.sneak = this.gameSettings.keyBindSneak.isKeyDown(); if (this.sneak) { this.moveStrafe = (float)((double)this.moveStrafe * 0.3D); this.moveForward = (float)((double)this.moveForward * 0.3D); } }
  19. I want to make a mod that will allow me to sprint whenever hit and walk a few blocks in a direction. I looked in the code but I can't see how the sprinting is activated/works. Here's what I tried: player.setSprinting(true); player.movementInput.forwardKeyDown=true; player.movementInput.moveForward=1.0F; player.moveForward=1.0F; In OnLivingUpdate the "this.movementInput.updatePlayerMoveState()" function is called which syncs with the keyboard. I thought this might simulate a keypress-it did not. Then I tried with travel: float forward=1.0F; if(dy>0) player.jump(); if(dist<0.21D) { forward=(float) (dist/0.21); } if(!player.isSprinting()) { player.movementInput.forwardKeyDown=true; player.setSprinting(true); } player.travel(0,0,forward); I noticed travel will not accept values over 1-it will round them up(with some friction calculation); I also noticed the distance at which the player moves using travel is around 0.21(on stone-on other blocks definitly will be different). Now , what is the connection between player.moveForward and player.motion[x,y,z] (motion seems to work- I know they are in different axis systems/views)? The second code works when local playing but fails on any other server I connect to (the server makes some checks). Why can't I fool the servers? The FOV changes for a few seconds but then it resets. I tried both codes in onPlayerTick and onLivingUpdate. Another thing: it works...sometimes..... on other servers if I guess the right number of ticks between travel calls. Why? If I hold a key pressed then travel should be called at every tick...why does my code have to skip a few? The mod is client side only.
  20. Sorry I wasn't explicit. I know how to check if tne item is of type Item<entity>. But I could not find any ItemIron or ItemIronIngot. Let's say I find another itemPickedUp event for client or perhaps I use IWorld class
  21. How can I detect that the picked item is an iron ingot? I use this event on the client side(the mod is only client side) public void onItemPickup(EntityItemPickupEvent event){ } I could not find any references to it on the internet.
  22. I want to detect the damage source in minecraft and print the user's name. How can I do it only on client side? I have some ideas:detect hit sound,follow the health bar,watch for sudden moves but all these are just hacky. I read on a forum that getCombatTracker might do something but I am not sure even how to use it. Is there an event that I can use in the newer version of forge that would tell me the damage source or at least confirm the damage ?
  23. Like Minecraft a=new Minecraft(null); ? this is were Eclipse lead me Isn't Minecraft. getMinecraft () also correct?
  24. Really sometimes I don't understand what Minecraft#player means : Minecraft.player (doesn't exist) or what?
×
×
  • Create New...

Important Information

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