Failender
Forge Modder-
Posts
1091 -
Joined
-
Last visited
Everything posted by Failender
-
Simulate a right click on a specific block?
Failender replied to Anon10W1z's topic in Modder Support
get the vector you need to look (blockvector-playervector) after that you need to get pitch and yaw from that. https://bukkit.org/threads/tutorial-how-to-calculate-vectors.138849/ -
Simulate a right click on a specific block?
Failender replied to Anon10W1z's topic in Modder Support
Ah im sorry I thought you had trouble with the setting player head part. What you need to do is calculate the vector from your eyes to the block and get the angles from it. player.getPositionEyes gets you the position of the players eyes as Vec3, getting the Vec3 from a BlockPos should be new Vec3(pos). After that its vector math -
Simulate a right click on a specific block?
Failender replied to Anon10W1z's topic in Modder Support
private float epicVariableOne, epicVariableTwo; @SubscribeEvent public void clientTick(ClientTickEvent event) { if(event.phase==Phase.END) return; epicVariableOne+=0.3f; epicVariableTwo+=0.3f; if(Minecraft.getMinecraft().thePlayer!=null)Minecraft.getMinecraft().thePlayer.setAngles(epicVariableOne, epicVariableTwo); } (This is part of an MinecraftForge EventBus) -
I already told you how to find them. They are in the minecraft class. If you are inside the class u can use Strg+F to search
-
[Solved][1.7.10] Using items from my other mods
Failender replied to shmcrae's topic in Modder Support
You need to add it to the build path.. -
Simulate a right click on a specific block?
Failender replied to Anon10W1z's topic in Modder Support
Take a look at the Minecraft class. Check the method rightClickMouse you will find everything you need there -
Simulate a right click on a specific block?
Failender replied to Anon10W1z's topic in Modder Support
This will only work for blocks. Do you want to do that on client or server side? -
[1.8.9] onPlayerStoppedUsing called twice / add new item attributes
Failender replied to Netglex's topic in Modder Support
I think what he means is that the method gets called twice (server/client) if he clicks once and the method gets called twice and the second run causes the weapon to shoot, because his variable is global. By the way if the server is on your local machine, do server and client share the same class for the items or are there two instances? -
[1.8.9] onPlayerStoppedUsing called twice / add new item attributes
Failender replied to Netglex's topic in Modder Support
First of all dont put variables inside the item class, because they are singletons and shared for all instances of your object. Use the itemStacks tagcompound Second why are you checking if your itemStack has the stacksize 0 ? -
If you are working on a client side mod the Minecraft class is your way to go. It has two methods "rightClickMouse" , and "clickMouse". You are free to guess what they do. The methods are private, so you need to use reflection to call them
-
[1.8] Pop up words on the middle of the screen
Failender replied to BaXMultigaming's topic in Modder Support
Have you tried the google? What is this kind of sorcery? -
Simulate a right click on a specific block?
Failender replied to Anon10W1z's topic in Modder Support
I tracked some call hierachy, and it seems like the Packet C08PacketPlayerBlockPlacement might be the thing you are looking for, even if if might be complicated using it correctly -
Failender and jsons, a never ending lovestory x) thank you for help sir! I was searching the error in the wrong file all the time
-
Hey everyone, I started doing my own crops and having trouble with the jsons. I get the following exception (8 times, for age from 0 to 7) Im a bit confused because I am quite certain that the jsons are correct. The models/block json (8 times from 0 to 7 blockstates Any help would be appreciated. Greetz Fail
-
[Solved][1.7.10] Using items from my other mods
Failender replied to shmcrae's topic in Modder Support
Add your mod to your workspace http://www.minecraftforge.net/forum/index.php?topic=19177.0 After that you can either just straight up import your stuff or use GameRegistry functions to get already registered items (GameRegistry.getRegisteredItem?) -
[1.8] Entity dies instantly when spawning (SOLVED)
Failender replied to YoungErtu's topic in Modder Support
UUID's use 128 bit. long use 64 bit. That means u can represent a UUID with 2 long, most significant and least significant. If you are a bit into computer science u will already know those two terms -
[Solved] [1.7.10] Changing vanilla block harvest levels
Failender replied to ax1m's topic in Modder Support
and im pretty sure that 1.7 will have a reference of the block that got broken.. aaaaaaaand I found it. its HarvestDropsEvent#block -
[Solved] [1.7.10] Changing vanilla block harvest levels
Failender replied to ax1m's topic in Modder Support
if(stack.getItem()==Items.iron) itsIron(); -
[Solved] [1.7.10] Changing vanilla block harvest levels
Failender replied to ax1m's topic in Modder Support
thats 1.8 code, (1.8 introduced IBlockState) but it should be easy to rewrite it for 1.7 -
[Solved] [1.7.10] Changing vanilla block harvest levels
Failender replied to ax1m's topic in Modder Support
setHarvestLevel on vanilla stuff will not do what you are expecting. you will need to use events for that. (in case I missed a patch that changed that please correct me) https://github.com/Failender/AdvancedTools/blob/master/main/java/de/failender/advancedtools/utils/ToolHandler.java -
yes. WorldSavedData OP!
-
[1.8.9] [Solved] Correct way to store non-item/non-entity data?
Failender replied to lynchiem's topic in Modder Support
nvm forgot to call setDirty. -
[1.8.9] [Solved] Correct way to store non-item/non-entity data?
Failender replied to lynchiem's topic in Modder Support
So when is writeToNBT getting called? I would expect it to be when the game gets safed to disk, but I got a sysout that is never shown sadly -
@SubscribeEvent public void onPlantGrowth(GrowthTick event) { if(event.world.isRemote) return; if(event.block instanceof IGrowable) { IGrowable growable = (IGrowable) event.block; if(!growable.canGrow(event.world, event.pos, event.currentState, false)) { addDecayer(new PlantDecayer(event.currentState, event.pos, event.world, TIME_TO_DECAY_MIN+event.world.rand.nextInt(TIME_TO_DECAY_RND))); } } } This is what I am doing right now. The add decayer is registering the position to a watcher that is a tick handler that checks after x seconds if the plant is still there. There you could just go ahead and get the blockstate with metadata 0, because thats normally the seed stage. Even if thats not what im triing to accomplish :b
-
Alright. I am at the point where I feel totally retarded. The mod wants me to get 1.8.9 . But I cant find forge for 1.8.9, only for 1.8 which seems to get me 1.8.0