
Need geckolib 4.2.2 or above!
需要geckolib 4.2.2或更高版本!
Out of my love for firearm mods and the scarcity of higher version firearm mods (Mr. crayfish,hurry update !), I decided to learn how to make a firearm mod myself, so the Simple Desert Eagle mod was born!
As a beginner (with Java foundation but no mod experience), it took me twelve days to create this module. Although its modeling animation is rudimentary, I am already satisfied with it. I will enrich it when I have time in the future (the final exam is coming soon QAQ).
出于我对枪支mod的热爱和更高版本枪支mod(小龙虾先生,快更新!)的稀缺性,我决定自己学习如何制作枪支mod,于是简单沙漠鹰mod诞生了!
作为一个初学者(有Java基础,但没有mod经验),我花了12天的时间创建了这个模块。虽然它的建模动画还很初级,但我已经对它很满意了。将来有时间我会丰富它(期末考试即将到来)。
It can be Dual Wielding, but it's best not to do this.
它可以是双持的,但是最好不要。
It has animations for firing and reloading. It can also break any glass(Including other modules like Alex's Mobs' Rainbow glass)
它具有射击和换弹的动画。它还可以打破任何玻璃(包括其他模组,如Alex's Mobs的彩虹玻璃)
Each type of Desert Eagle has different damage and cooldown times, and can be easily crafted in survival mode. There's a hidden advancement waiting for you to discover!
每种类型的沙漠之鹰都有不同的伤害和冷却时间,并且可以在生存模式下轻松制作。还有一个隐藏的进度等待你去发现!
The following is the mental journey
Development is not easy. Thank you for liking it. The picture below is the running log of the first week... It took me three days to make the modeling animation of firing and reloading. When I introduced bullet storage, I found that the NBT label was not that simple. Modifying the NBT label of the item would Triggering the switching item animation caused a conflict with the firing animation. I spent a lot of time researching this, tried various methods, asked the geckolib author, and even tried to offset it by making it move in the opposite direction in the animation. Finally, by studying the source code of Flan firearms, I learned to use composite NBT tags to prevent item switching animations from being triggered when bullet data changes. This experience taught me a lot about the underlying layers of Minecraft. For example, the item class is not an item and an object, but an item stack and an object... Therefore, the bullet data cannot be saved by writing a local variable in the gun class, otherwise the bullets for each gun will be the same! But geckolib does a good job. It gives each item an ID, so that when calling animation in the item class, all items will not play animation together. However, playing animation through the geckolib plug-in process in MCreator will cause all items to play together. To play animations, I can only check the official geckolib documentation to solve the problem of playing animations... But I have to say that MCreator is good at helping novices write code, although if I only use MCreator, these effects will not appear. , but at least it allows us to modify its underlying code.
下面是新路历程
开发不易谢谢你能喜欢~下图是第一周的运行日志...花了三天做了开火换弹建模动画,结果引入子弹存储的时候发现NBT标签没有那么简单,修改物品NBT标签会触发切换物品动画,导致和开火动画冲突,为此我投入了大量时间去研究,尝试了各种方法,也曾询问geckolib作者,甚至试过通过在动画中让它反向移动来抵消。最后通过研究Flan枪械的源码才学会用复合NBT标签来阻止子弹数据改变时触发切换物品动画,这次经历让我对Minecraft底层了解了不少。比如物品类并非一个物品一个对象,而是一个物品栈一个对象...所以子弹数据不能写个枪类里的局部变量来保存,不然会导致每一把枪子弹都一样!但是geckolib做的很好,它把每个物品都做了个id,这样在物品类调用动画就不会所有物品一起播放动画,但是通过MCreator里的geckolib插件流程做的播放动画会导致所有物品一起播放动画,为此我只能去查geckolib官方文档来解决播放动画的问题...不过不得不说,MCreator在帮新手写代码方面还是不错的,虽然如果我只用MCreator做不出现在这些效果,但至少它支持我们修改它的底层代码。