Everything posted by Crazy_sheep
-
CLOSED:How to get Private Value?
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");
-
CLOSED:How to get Private Value?
@Danebiok i am gonne try
-
CLOSED:How to get Private Value?
@Draco18sso do i just need to put ObfuscationReflectionHelper.getPrivateValue(CreeperEntity.class, null,"field_184714_b"); into the field?
-
CLOSED:How to get Private Value?
@loordgekbut what code do i need to put in it???
-
CLOSED:How to get Private Value?
how long will this topic go on because i wanna close it but i am only gonne close it if i have a awnser
-
CLOSED:How to get Private Value?
but how do i inalize it?
-
CLOSED:How to get Private Value?
@loordgekbut i have the value how do i inalize it do
-
CLOSED:How to get Private Value?
there is a command that is called this creeper.getDataManager().getAll(); can i do someting with this
-
CLOSED:How to get Private Value?
and can i do something with this creeper.getDataManager()
-
CLOSED:How to get Private Value?
@diesieben07can you give me a fast example of a field and i am not asking for the real code
-
CLOSED:How to get Private Value?
@diesieben07ok i am quikly gonne learn what fields are and come back to the code
-
CLOSED:How to get Private Value?
@diesieben07hmmm.... how do i do that🤔
-
CLOSED:How to get Private Value?
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
-
CLOSED:How to get Private Value?
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)
-
CLOSED:How to get Private Value?
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) { } } }
-
CLOSED:How to get Private Value?
@diesieben07what do you mean just the normal meaning because that is to show something
-
CLOSED:How to get Private Value?
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
-
CLOSED:How to get Private Value?
@loordgekok but i got errors with trying to do that so how do i fix
-
CLOSED:How to get Private Value?
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?
-
CLOSED:How to get Private Value?
sorry but i still dont get it🤔but is there a way to edit the CreeperEntity.java file so i can make it public?
-
CLOSED:How to get Private Value?
@Draco18s where is the the javadoc? because i am not good at intellij so how do i do that
-
CLOSED:How to get Private Value?
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
-
CLOSED:How to get Private Value?
nice! but i know how the getPrivateValue works! but idk how to make it accessible
-
CLOSED:How to get Private Value?
i just made another mod and what it does when i jump it kills me(why did i make this...)
-
CLOSED:How to get Private Value?
@loordgekwell i will first go for option 1 and i am trying to learn java but its pretty hard
IPS spam blocked by CleanTalk.