Posted March 17, 201510 yr 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.
March 17, 201510 yr 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.
March 17, 201510 yr Author I got that but what if you wanted some sound and smoke when you right click the item
March 18, 201510 yr 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.
March 18, 201510 yr 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.