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

I am making some type of warfare mod and I need help because I have looked up tutorials and none of them helped that well, so can one of y'all send me tutorials video or something.  :D

Uhm, you will need to know stuff about:

- Item

- onRightClick method (in item)

- server/client thread

- understand that bullet is an entity, which is spawned into world on shoot (server side)

- know how to operate on NBTTags to save ammo, reaload time, recoil and special attributes

- RenderGameOverlayEvent will be useful to dosplay ammo / gui stuff onto screen

- learn how velocity works (some math sometimes) and how stuff "goes" in world (bullets)

 

Everything can be found:

- Basic setup, using NBT (examples)

http://www.minecraftforge.net/forum/index.php/topic,26267.0.html

- Help understanding NBT (maybe)

http://www.minecraftforge.net/wiki/Creating_NBT_for_items

- Making game overlay

http://www.minecraftforge.net/wiki/Gui_Overlay

- Spawning entity (bulllet) into world:

* You will need to look how fireball/snowballs are spawned in MC, quite easy (just look at vanilla)

* Extend EntityThrowable and make bullets

 

This all should give you everything you need to know.

 

Also additional: If you'd like to save per-entity (per player for e.g) data like reloading or some timers - use IEEP (IExtendedEntityProperties) - 2nd post in link

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571567-1-7-2-1-6-4-eventhandler-and

 

EDIT: MOST of ALL - you will need to know JAVA and have patience to make this properly.

 

1.7.10 is no longer supported by forge, you are on your own.

  • Author

I got that but what if you wanted some sound and smoke when you right click the item

Then you (also in rightClick) will want to spawn particle - CLIENT side, in x/y/z of world where gun was shot (probably very near player).

 

Particles are also pretty easy to spawn - most of the stuff you want to write is alredy in vanilla (for me, best teacher that ever existed).

Example from TNT code:

this.worldObj.spawnParticle(EnumParticleTypes.EXPLOSION_HUGE, this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D, new int[0]);

have look at TNT obviously and EnumParticleTypes. Rest is self-explainatory. For custom particles I don't have right to say anything (never used them yet), but stuff will be probably the same - extend EntityFX and do your stuff, then spawn in on lcient side.

 

EDIT: Oh and sounds.

It's literally same, you just do what vanilla does:

world.playSound((double)x, (double)y, (double)z, "name", 100F, 1F, true); // look at the method itself.

 

As for this, I am not sure (I am outdated here), but there might be methods to play sounds on client and on server, wheras playing them on server will cause all players in range hear them. There must be something on google for this.

 

1.7.10 is no longer supported by forge, you are on your own.

Well I think there is player.playSoundEffect and it should play it just to that player.

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.