I'm not sure about MCreator doing this but I know you can add some motionX and motionZ to the player to get him/her to move an amount of blocks on the x or z axis.
Have you tried using player.rayTrace(int, float)? This method will give a MovingObjectPosition referencing the trace of where the player is looking at. You can get x, y, z coords from this. Just remember to add the eye height of the player (annoying bug in 1.7.10)
For starts, you should export your model in Java to your IDE. (should be either Intellij or Eclipse) There, you can fix up some errors like an Entity parameter not being where it should be and importing all of the modules used. Then, you have to code the moving of the entity which you can do via 1.8 tutorials.
Finally, there are the rendering of the entity and the actual entity.
- The rendering is done via a ResourceLocation which is basically a file path telling Minecraft where your entity texture is.
- The actual entity is done by specifying specific AI to the constructor and maybe adding custom drops by overriding methods.
Sorry if it sounds confusing but that's a complete summary of what you need to do.
You can subscribe to the EntityJoinWorldEvent and check if the Entity is an EntityPlayer. If it is, you can use the player.inventory.addItemStackToInventory(ItemStack i) to add your item to the player's inventory. Seeing as you are new to modding, here is a good tutorial on how to use events:
Link Removed is a video series by CJMinecraft that goes pretty in depth into coding Minecraft.
Also, there are quite a lot of differences between 1.7.10 and 1.8.9 code such as BlockPos and new blockstates but you should mostly watch the video series.
In addition, MrCrayfish might have a 1.10.2 tutorial and that might be even better.
0
Took a while, but I found what seems to be a stable way.
this.getNavigator().tryMoveToXYZ(int x, int y, int z, int speed);
The method might work with moving your entity to where the player is looking but the code I'm looking from uses it in AI.
Anyways, try it!
0
I'm not sure about MCreator doing this but I know you can add some motionX and motionZ to the player to get him/her to move an amount of blocks on the x or z axis.
0
Have you tried using player.rayTrace(int, float)? This method will give a MovingObjectPosition referencing the trace of where the player is looking at. You can get x, y, z coords from this. Just remember to add the eye height of the player (annoying bug in 1.7.10)
0
Here are some troubleshooting tips: (since Eclipse should tell you if you have an error)
p.s: As a mod creator, I strongly suggest you migrate to 1.10.2
0
For starts, you should export your model in Java to your IDE. (should be either Intellij or Eclipse) There, you can fix up some errors like an Entity parameter not being where it should be and importing all of the modules used. Then, you have to code the moving of the entity which you can do via 1.8 tutorials.
Finally, there are the rendering of the entity and the actual entity.
- The rendering is done via a ResourceLocation which is basically a file path telling Minecraft where your entity texture is.
- The actual entity is done by specifying specific AI to the constructor and maybe adding custom drops by overriding methods.
Sorry if it sounds confusing but that's a complete summary of what you need to do.
0
Hey everyone,
V 1.2 of the mod is finally out!
You can experience the wonders of the sky in this version as well as experience hidden secrets in the lucky blocks!
Reshifted the mod's focus more on the elemental things now.
See the main post for more info.
0
You do tm: with the colon because Minecraft will recognize that as a modid. And yeah, get rid of the substring() and just put super_sword
0
The line of code that I am referring to is in your ToolItems class at line 20.
0
For items, it is as simple as writing
this.setMaxStackSize(int stackSize)
and filling the int with your designated stack size.
1
Your problem is that you registered your registry name wrong. To check what your actual name is, load Minecraft, open the command console and type in
/give <player> tm: and then hit Tab.
Hitting Tab will show you what your actual name in the game is. The line you need to change is:
GameRegistry.registerItem(Item i, String name)
Change the name to super_sword.
0
I believe that in your block class, there should be a method called randomDisplayTick() where you place particles on your block.
In there, you need to get an instance of the player from the World parameter and check if they are holding your specific item.
If so, you can show the particles to the player which is done via world.spawnParticle(EnumParticleType, int, int, int, double, double, double, int[])
0
You can subscribe to the EntityJoinWorldEvent and check if the Entity is an EntityPlayer. If it is, you can use the player.inventory.addItemStackToInventory(ItemStack i) to add your item to the player's inventory. Seeing as you are new to modding, here is a good tutorial on how to use events:
http://jabelarminecraft.blogspot.com/p/minecraft-forge-172-event-handling.html
P.S: I'd suggest updating to a newer version when creating a mod like doing 1.8 or 1.10.2
0
Link Removed is a video series by CJMinecraft that goes pretty in depth into coding Minecraft.
Also, there are quite a lot of differences between 1.7.10 and 1.8.9 code such as BlockPos and new blockstates but you should mostly watch the video series.
In addition, MrCrayfish might have a 1.10.2 tutorial and that might be even better.
0
You would have to either ask the creator of the mod yourself for an updated version or open source code to know how to update the mod.
If the creator doesn't respond, you'll have to update it yourself (using new code to freshen it up) using 1.8.9 code.
0
Ya, you can make your heavy sword actually a sword.
1. If you want to make a tool that does a lot of damage ("sword"), just change the 5th parameter in EnumHelper.addToolMaterial() to a higher number.
2. If you want a regular sword, just make the class extend ItemSword. Then, get rid of the second parameter in super() and the getStrVsBlock() method