Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Crazy_sheep

Members
  • Joined

  • Last visited

Everything posted by Crazy_sheep

  1. i think i am getting very close to the answer but how do i set it? because i have this static DataParameter<Boolean> test = ObfuscationReflectionHelper.getPrivateValue(CreeperEntity.class, null,"field_184714_b");
  2. @Danebiok i am gonne try
  3. @Draco18sso do i just need to put ObfuscationReflectionHelper.getPrivateValue(CreeperEntity.class, null,"field_184714_b"); into the field?
  4. @loordgekbut what code do i need to put in it???
  5. how long will this topic go on because i wanna close it but i am only gonne close it if i have a awnser
  6. but how do i inalize it?
  7. @loordgekbut i have the value how do i inalize it do
  8. there is a command that is called this creeper.getDataManager().getAll(); can i do someting with this
  9. and can i do something with this creeper.getDataManager()
  10. @diesieben07can you give me a fast example of a field and i am not asking for the real code
  11. @diesieben07ok i am quikly gonne learn what fields are and come back to the code
  12. @diesieben07hmmm.... how do i do that🤔
  13. package com.example.examplemod.event; import com.example.examplemod.ExampleMod; import net.minecraft.entity.monster.CreeperEntity; import net.minecraft.network.datasync.DataParameter; import net.minecraft.network.datasync.EntityDataManager; import net.minecraft.world.World; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.ObfuscationReflectionHelper; @Mod.EventBusSubscriber(modid = ExampleMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) // filename: Main.java class Test { static int i; int j; // start of static block static { i = 10; ObfuscationReflectionHelper.getPrivateValue(CreeperEntity.class, null,"field_184714_b"); } // end of static block } public class Event { public static DataParameter<Boolean> test; //I FIXED IT YAY @SubscribeEvent public void onspawn(EntityJoinWorldEvent e, World world) { CreeperEntity creeper = (CreeperEntity) e.getEntity(); if (creeper instanceof CreeperEntity) { EntityDataManager // i am stuck here now } } } is this good and i got lost by the EntityDataManager part
  14. bro... i dont use Eclipse i use intellij and i did not do quickfixes that e was just a fast test if that worked as a name(and i am trying to make a doom mod lol)
  15. i showed where the first error came from @Draco18sok here is the code from the events class package com.example.examplemod.event; import com.example.examplemod.ExampleMod; import net.minecraft.entity.monster.CreeperEntity; import net.minecraft.network.datasync.DataParameter; import net.minecraft.world.World; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod; @Mod.EventBusSubscriber(modid = ExampleMod.MOD_ID, bus = Mod.EventBusSubscriber.Bus.FORGE) public class Event { public static DataParameter<Boolean> e; //I FIXED IT YAY @SubscribeEvent public void onspawn(EntityJoinWorldEvent e, World world) { CreeperEntity creeper = (CreeperEntity) e.getEntity(); if (creeper instanceof CreeperEntity) { } } }
  16. @diesieben07what do you mean just the normal meaning because that is to show something
  17. ok lemme pop up my ide really quikly and it already errors at the first part this private static DataParameter<Boolean> and static DataParameter<Boolean> this does not work and public too
  18. @loordgekok but i got errors with trying to do that so how do i fix
  19. btw if a was away i was at school sorry but where are we ah ok @LexManosbut i wanna set it @loordgekwhats the easyest way to set it to true?
  20. sorry but i still dont get it🤔but is there a way to edit the CreeperEntity.java file so i can make it public?
  21. @Draco18s where is the the javadoc? because i am not good at intellij so how do i do that
  22. yeah because documentations(not forums(because forums is the best)) on forge are really bad to be for real this is all i can find for documentations https://www.programcreek.com/java-api-examples/?class=net.minecraftforge.fml.common.ObfuscationReflectionHelper&method=getPrivateValue https://skmedix.github.io/ForgeJavaDocs/javadoc/forge/1.9.4-12.17.0.2051/net/minecraftforge/fml/common/ObfuscationReflectionHelper.html https://www.codota.com/code/java/methods/net.minecraftforge.fml.common.ObfuscationReflectionHelper/setPrivateValue https://www.codota.com/code/java/classes/net.minecraftforge.fml.common.ObfuscationReflectionHelper this is all i can find EDIT: i found another command to change the boolean its called setPrivateValue not get but set
  23. nice! but i know how the getPrivateValue works! but idk how to make it accessible
  24. i just made another mod and what it does when i jump it kills me(why did i make this...)
  25. @loordgekwell i will first go for option 1 and i am trying to learn java but its pretty hard

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.