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.

Featured Replies

Posted

Good days

bad english advertishment.

 

 

im in neeed of another method, this time a have an item called "itemMercenario00" i whish this method on rigth click on a block whit this item in hand return the coordenadas x y z of the block, like

 

entitiplayer.getOnfocusBlockCordenadas(entity ,  x,  y,  z);

 

example, i have a custom stick on mi hand, hit  a block whit the stick , it return position(x, y, z); of the block hit.

 

 

in the other hand  i been played minecraft just like a year and half, and beging whi this of the mods this sunday, soo im very newbii whith this

is there somewhere a list of everymethod avaliable in 1.7.10 something sorted like the java documentation but filled whit the notch teachings ??

 

 

 

 

  • Author

Solve the part of the method to return the block cordenadas on click

 

public ItemStack onItemRightClick(ItemStack p_77659_1_, World p_77659_2_, EntityPlayer p_77659_3_){

 

//###########################################

System.out.println("###########################################");

MovingObjectPosition mop = Minecraft.getMinecraft().renderViewEntity.rayTrace(20, 1.0F);

if(mop != null)

{

    int blockHitSide = mop.sideHit;

    Block blockLookingAt = p_77659_2_.getBlock(mop.blockX, mop.blockY, mop.blockZ) ;

   

    float fx=mop.blockX;

    float fy=mop.blockY;

    float fz=mop.blockZ;

   

System.out.println("fx="+fx+" fy="+fy+" fz="+fz);   

}

}

 

 

but still need the list.

Hi

 

Unfortunately the list doesn't exist.  There are some partial lists, mostly out of date.

You can browse through the forgeSrc packages; some of it is well documented, some of it isn't.

 

The way I find usually works well is

1) think of something in vanilla that works similar to what I want (eg I want to make a tomato plant that grows like wheat)

2) find out where wheat is in the vanilla code.  A full text search on the package usually gives good results.  For blocks and items you can browse through the Blocks and Items classes to see a list.

3) go look at the vanilla code to see which methods it overrides and what the various methods do, if they call other classes.

4) write some test code based on the vanilla code, test it, swear a lot, look at some more vanilla code, tweak my code again, perhaps read the forum, keep trying until the test code works or it reaches 2am and it's time to go to sleep.

 

My biggest hint is - take baby steps, don't try to do it all at once.  Do something simple, test it till it works, then add a bit more code, test it till it works, etc.  It's much quicker that way.

 

-TGG

 

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.