-
Posts
444 -
Joined
-
Last visited
Everything posted by brandon3055
-
Because part of the way minecraft checks if an item is enchantable is wit this method public boolean isItemTool(ItemStack p_77616_1_) { return this.getItemStackLimit(p_77616_1_) == 1 && this.isDamageable(); } to fix your problem you need to override isItemTool in your item class and return true.
-
Sending Data to Server through DataWatchers
brandon3055 replied to david476's topic in Modder Support
iff you are sending packets to the server for control and thats where you need the entity in your message handler you can get the plater that sent the packet using. messageContext.getServerHandler().playerEntity -
Sending Data to Server through DataWatchers
brandon3055 replied to david476's topic in Modder Support
why cant you just use player.ridingEntity to get the entity the player is riding? -
Oh i see its in the wrong spot it should be here if (playersWithFlight.get(player) && !player.worldObj.isRemote) { //<--- playersWithFlight.put(player, false); if (!player.capabilities.isCreativeMode) { player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.sendPlayerAbilities(); } } But if its working for you it probably dosnt matter.
-
OOOh change if (event.phase != TickEvent.Phase.START || event.player.worldObj.isRemote) return; to if (event.phase != TickEvent.Phase.START || !event.player.worldObj.isRemote) return; and that should do the trick. Edit infact remove the isRemote altogether if (event.phase != TickEvent.Phase.START) return;
-
Ok it worked as we planned When it was on: Equipment Stack 1xitem.GravityChestplate@0 Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead Target Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead true When it was off: Equipment Stack null Target Item com.skullcrusher.BetterThings.Armor.GravityArmor@4aa33ead false did you copy just the changes or the entire class?
-
"Raze_carbondrop" is not an item it is your ModItem class try Raze_carbondrop.CDrop
-
oops remove .getItem() from the first System.out so System.out.println("Equipment Stack "+getEquipmentInSlot(3)); if (event.player.getEquipmentInSlot(3) != null) System.out.println("Item "+event.player.getEquipmentInSlot(3).getItem()); System.out.println("Target Item"+BetterThings.GravityChestplate); if (event.player.getEquipmentInSlot(3) != null && event.player.getEquipmentInSlot(3).getItem() == BetterThings.GravityChestplate) and make sure you are wearing the chestplate it crashed because it tried to get the item from the stack in your chestplate slot but that stack was null.
-
In future try to give more detail in your first post then just "Its not working. Help me fix it"
-
I think toy need to actually create an item class that extends Item. What you have done there may be possible but i have never seen it done before. And you still havent clarified the problem do you mean the block dosnt drop that item when you break it?
-
onItemLeftClick() onItemMiddleClick() methods exist ?
brandon3055 replied to perromercenary00's topic in Modder Support
I dont believe the method you are looking for exists. You may have to just use an event handler. -
There are two ways of registering event handlers the MinecraftForge event is the 2nd way FMLCommonHandler.instance().bus().register(new ClassName()) is another way. Thats kinda correct. There are multiple different event busses MinecraftForge.EVENT_BUS and FMLCommonHandler.instance().bus() are just 2 of therm and they each handle different events so you need to register your event to the correct buss which in this case is FMLCommonHandler.instance().bus() And he isnt working on the client side. @OP Well you are closer atleast try adding System.out.println("Equipment Stack "+getEquipmentInSlot(3).getItem()); if (event.player.getEquipmentInSlot(3) != null) System.out.println("Item "+event.player.getEquipmentInSlot(3).getItem()); System.out.println("Target Item"+BetterThings.GravityChestplate); if (event.player.getEquipmentInSlot(3) != null && event.player.getEquipmentInSlot(3).getItem() == BetterThings.GravityChestplate) bellow if (event.phase != TickEvent.Phase.START || event.player.worldObj.isRemote) return; and tell me what is printed to the console.
-
Just to clarify what The_Fireplace said (which is 100% correct) nei scans all mods loaded for a class named NEI[some name]Config and calls the "loadConfig()" method within it. For this to work you need to add nei to your workspace as a library.
-
I may be wrong but it dosnt look like there is... atleast no easy way your best bet is probably to just replace it.
-
Entity moving after setting motion to zero
brandon3055 replied to charsmud's topic in Modder Support
I just checked some code i used to ass velocity to an entity and i used entity.addVelocity(d2 / d4 * 8.0D, 5.20000000298023224D, d3 / d4 * 8.0D); entity.velocityChanged = true; so maby try entity.setVelocity(0D, 0D, 0D); entity.velocityChanged = true; Edit: i just threw that into my LivingUpdateEvent handler and it froze every entity in the world so if it dosnt work you you it must be as you said "the block's update loop is being called before the entity"