Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • CLOSED:How to get Private Value?
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 2
Crazy_sheep

CLOSED:How to get Private Value?

By Crazy_sheep, October 23, 2020 in Modder Support

  • Reply to this topic
  • Start new topic
  • Prev
  • 1
  • 2
  • 3
  • 4
  • Next
  • Page 2 of 4  

Recommended Posts

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 25, 2020 (edited)

@loordgekbut i dont know how to use the getPrivateValue can you maybe help me with that it would really help😉

Edited October 25, 2020 by Crazy_sheep
  • Quote

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1797 posts
Posted October 25, 2020

i told you how to do it but you dont have the java knowledge to understand it so plz learn java

  • Quote

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 25, 2020
1 hour ago, loordgek said:

i told you how to do it but you dont have the java knowledge to understand it so plz learn java

thats what i am trying but learning java is kinda boring

  • Quote

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1797 posts
Posted October 25, 2020

what would you have

1 a boring time learning java

2 a frustrating time modding and not getting somewhere

 

  • Quote

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 25, 2020

@loordgekwell i will first go for option 1 and i am trying to learn java but its pretty hard

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2403

Draco18s

Draco18s    2403

  • Reality Controller
  • Draco18s
  • Members
  • 2403
  • 15927 posts
Posted October 25, 2020

I guess you should find some other hobby then.

Because programming is work.

  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 25, 2020
19 minutes ago, Draco18s said:

I guess you should find some other hobby then.

Because programming is work.

i just made another mod and what it does when i jump it kills me(why did i make this...)

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2403

Draco18s

Draco18s    2403

  • Reality Controller
  • Draco18s
  • Members
  • 2403
  • 15927 posts
Posted October 25, 2020

Cool.

I did this in a week.

https://draco18s.itch.io/time-slicing-sword

  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 26, 2020
18 hours ago, Draco18s said:

Cool.

I did this in a week.

https://draco18s.itch.io/time-slicing-sword

nice! but i know how the getPrivateValue works! but idk how to make it accessible

  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2403

Draco18s

Draco18s    2403

  • Reality Controller
  • Draco18s
  • Members
  • 2403
  • 15927 posts
Posted October 26, 2020

If only there was some documentation in the ObfuscationReflectionHelper class

  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 26, 2020 (edited)
1 hour ago, Draco18s said:

If only there was some documentation in the ObfuscationReflectionHelper class

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

Edited October 26, 2020 by Crazy_sheep
  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2403

Draco18s

Draco18s    2403

  • Reality Controller
  • Draco18s
  • Members
  • 2403
  • 15927 posts
Posted October 26, 2020 (edited)

All Forge javadoc is inside the class on each method.  All you have to do is open up the file in your IDE.

https://github.com/MinecraftForge/MinecraftForge/blob/638d1d31deabd8a83cf4b84496549703bc527ab4/src/main/java/net/minecraftforge/fml/common/ObfuscationReflectionHelper.java#L67-L83

Edited October 26, 2020 by Draco18s
  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 26, 2020 (edited)

@Draco18s where is the the javadoc? because i am not good at intellij so how do i do that

Edited October 26, 2020 by Crazy_sheep
  • Quote

Share this post


Link to post
Share on other sites

Draco18s    2403

Draco18s

Draco18s    2403

  • Reality Controller
  • Draco18s
  • Members
  • 2403
  • 15927 posts
Posted October 26, 2020 (edited)

https://www.jetbrains.com/help/decompiler/Navigation_and_Search__Go_to_Declaration.html#c654

 

Among other ways. Use Google to ask questions like "how do I view source for this?"

Edited October 26, 2020 by Draco18s
  • Quote

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 26, 2020
10 minutes ago, Draco18s said:

https://www.jetbrains.com/help/decompiler/Navigation_and_Search__Go_to_Declaration.html#c654

 

Among other ways. Use Google to ask questions like "how do I view source for this?"

sorry but i still dont get it🤔but is there a way to edit the CreeperEntity.java file so i can make it public?

  • Quote

Share this post


Link to post
Share on other sites

poopoodice    111

poopoodice

poopoodice    111

  • Dragon Slayer
  • poopoodice
  • Members
  • 111
  • 893 posts
Posted October 26, 2020

I feel we are repeating everything in the last exact same topic you posted...

 

Answers are all in there, please at least try and have a research on some of those suggestions, then ask if there's something you don't understnad.

  • Quote

Share this post


Link to post
Share on other sites

LexManos    1617

LexManos

LexManos    1617

  • Reality Controller
  • LexManos
  • Forge Code God
  • 1617
  • 8928 posts
Posted October 27, 2020

Why do you need that field?

Seriously.. there is a getter

   public boolean isCharged() {
      return this.dataManager.get(POWERED);
   }

If you want to set it to true, just do what vanilla does and strike it with lightning.

You could also probably set the data manager directly via id, or using the readFromNBT function. There are many ways to do it.

Either way everyone else is correct you need to understand the basics of java and what classes and methods are.

Also POWERED is not a boolean its a DataParameter. So you wouldnt set it, you'd just get it and then use it to set the dataManager entry.

 

So ya, there are MANY ways you can do this, all of them are fairly well documented and could easily be found by understanding the basics of java and the things people in this thread have said.

Next time you try and tackle a subject, describe what you want to do, not how you want to do it.

You dont need to set/get a proviate value, you just want to make a creeper charged or not.

  • Quote

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Patreon: http://www.patreon.com/lexmanos
Paypal: http://paypal.me/LexManos

BitCoin: 1Q8rWvUNMM2T1ZfDaFeeYQyVXtYoeT6tTn

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1797 posts
Posted October 27, 2020
8 hours ago, LexManos said:

Why do you need that field?

Seriously.. there is a getter

but we need a setter

 

8 hours ago, LexManos said:

If you want to set it to true, just do what vanilla does and strike it with lightning.

that has unwanted side effects

 

9 hours ago, LexManos said:

You could also probably set the data manager directly via id

how ??

 

9 hours ago, LexManos said:

You dont need to set/get a proviate value, you just want to make a creeper charged or not.

he needs the DataParameter and that is private

  • Quote

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 27, 2020

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?

  • Quote

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1797 posts
Posted October 27, 2020

the way i told you

  • Quote

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 27, 2020

@loordgekok but i got errors with trying to do that so how do i fix

  • Quote

Share this post


Link to post
Share on other sites

loordgek    174

loordgek

loordgek    174

  • World Shaper
  • loordgek
  • Members
  • 174
  • 1797 posts
Posted October 27, 2020

show what you have tried

  • Quote

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 27, 2020 (edited)

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

Edited October 27, 2020 by Crazy_sheep
  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7596

diesieben07

diesieben07    7596

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7596
  • 55097 posts
Posted October 27, 2020

Do you understand the meaning of the word "show"?

  • Quote

Share this post


Link to post
Share on other sites

Crazy_sheep    1

Crazy_sheep

Crazy_sheep    1

  • Stone Miner
  • Crazy_sheep
  • Members
  • 1
  • 94 posts
Posted October 27, 2020

@diesieben07what do you mean just the normal meaning because that is to show something

  • Quote

Share this post


Link to post
Share on other sites
  • Prev
  • 1
  • 2
  • 3
  • 4
  • Next
  • Page 2 of 4  

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 2
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Turtledove
      Server->Client packets aren't working [1.16.3]

      By Turtledove · Posted 8 minutes ago

      Solved it myself: when handle() is called it's (in the context of server->client) called on the logical client, ctx.getSender() is going to return null. So just use Minecraft.instance.player.
    • Ronshark
      Neige Winter is Here

      By Ronshark · Posted 21 minutes ago

      Bonjour a tous Je me demandais, comment on pouvais enlever les particule de neige qui tombent sur le modpack Winter is Here 
    • Draco18s
      [1.16.4] what difference between custom slots and EquipmentSlotType

      By Draco18s · Posted 31 minutes ago

      Why did you create two lazy optionals, then unbox them to pass into the CombinedInvWrapper? (Not to mention using an array to store the local results? Why!?) return LazyOptional.of(() -> (T)new CombinedInvWrapper(getHandler(), new EntityArmorInvWrapper(entity)));
    • Malkar
      Java install not complete

      By Malkar · Posted 52 minutes ago

      Okay, so I've been trying to install Forge to mod my minecraft game for a while, but every time I try, the installer doesn't install it and prompts me with this error   "Unable to Install Java   there are errors in the following switches: "C:\User\*****\AppData\roaming\.minecraft\forge-1.14.4-28. 2.23-installer.jar";.   Check that the commands are valid and try again."   I have Java istalled, but I don't think that it has anything to do with it. I need help fixing this, please.
    • Klarks
      [1.16.4] what difference between custom slots and EquipmentSlotType

      By Klarks · Posted 1 hour ago

      I created now. public MyEntity(EntityType<? extends MyEntity> type, World worldIn) { super(type, worldIn); handler = getHandler(); optional = create(this); } do i need this? public <T> LazyOptional<T> create(LivingEntity entity) { LazyOptional<IItemHandlerModifiable>[] ret = new LazyOptional[2]; ret[0] = LazyOptional.of(() -> getHandler()); ret[1] = LazyOptional.of(() -> new EntityArmorInvWrapper(entity)); return LazyOptional.of(() -> (T)new CombinedInvWrapper(ret[0].orElse(null), ret[1].orElse(null))); }   here i got default handler    public <T> LazyOptional<T> getCapability(@Nonnull Capability<T> cap, @Nullable Direction side) { if(cap == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) { defHandler = (ItemStackHandler) super.getCapability(cap,side).orElse(null); return create(this); } return super.getCapability(cap, side); } public ItemStack func_213803_dV() { return this.getItemStackFromSlot(EquipmentSlotType.CHEST); } Am i going right?
  • Topics

    • Turtledove
      1
      Server->Client packets aren't working [1.16.3]

      By Turtledove
      Started 1 hour ago

    • Ronshark
      0
      Neige Winter is Here

      By Ronshark
      Started 21 minutes ago

    • Klarks
      22
      [1.16.4] what difference between custom slots and EquipmentSlotType

      By Klarks
      Started 13 hours ago

    • Malkar
      0
      Java install not complete

      By Malkar
      Started 52 minutes ago

    • BoGuBoy
      0
      3rd party hosted Server wont launch

      By BoGuBoy
      Started 1 hour ago

  • Who's Online (See full list)

    • nblock3
    • JDLogic
    • diesieben07
    • Turtledove
    • Luis_ST
    • MemeMan
    • CakeMask
    • DaemonUmbra
    • florianruecker06@gmail.com
    • Ronshark
    • Malkar
    • st4s1k
    • Novârch
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • CLOSED:How to get Private Value?
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community