Jump to content

Recommended Posts

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

Posted

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.

Posted

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.

Posted

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...

×   Pasted as rich text.   Restore formatting

  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.

Announcements



×
×
  • Create New...

Important Information

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