Jump to content

Anon10W1z

Forge Modder
  • Posts

    311
  • Joined

  • Last visited

Everything posted by Anon10W1z

  1. If you use comments and JavaDoc it will look much nicer.
  2. I found this code: @SubscribeEvent public void onEntityUpdate(LivingUpdateEvent event) throws InterruptedException { } But I need to get the current player that is grabbing it ... It would be perfect if i can set a "grabber-id" variable on the entity with which to obtain the player.. or How can i do it? First off, remove that throws declaration, Second, look up data watchers.
  3. I take it one step further and make my event handler final. Then I store the singleton instance of the event handler in itself.
  4. You need to use posSide when getting the block state from the world.
  5. It's good that you have put in effort to learn, and the desire is there. However, for server-side modding, Bukkit plugin development is what you want to look into, not Forge modding. Look up kennethbgoodin Bukkit tutorials on YouTube. They're great for beginners.
  6. http://www.minecraftforge.net/forum/index.php/topic,26403.0.html
  7. Did you register the inventory block renderer?
  8. The hell? Don't use reflection. Use player.capabilities...
  9. EDIT: Ok this is getting really weird: Apparently my code works 100% correctly. The only problem is that on loading a world where the block is already placed, nothing happens. If I set a new block, it works without any problem. Really strange. Ah, this is because if you add a tile entity to your block, then blocks placed before the tile entity was added will not have the tile entity. Tile entities are only added when the block is placed.
  10. MinecraftServer.getServer().getCommandManager().executeCommand(player, command); Runs a command. Set your block to tick randomly and override the on random tick method.
  11. Look at the Minecraft wiki for color codes. Use them in your language file.
  12. This is an error with your block...make sure you override getMetaFromState as well as getStateFromMeta
  13. Alright then. public class YourEventHandler { @SubscribeEvent public void onBlockBreak(BlockEvent.BreakEvent event) { //do stuff } } And in your init method in the main mod file, put MinecraftForge.EVENT_BUS.register(new YourEventHandler());
  14. I see you used diesieben07's tutorial. Read the replies, you'll find the SRG names. Add them to the lines following like so: private static final Field eventHandlerField = ReflectionHelper.findField(InventoryCrafting.class, "eventHandler", "srgEventHandlerNameGoesHere"); private static final Field containerPlayerPlayerField = ReflectionHelper.findField(ContainerPlayer.class, "thePlayer", "sameForThePlayer"); private static final Field slotCraftingPlayerField = ReflectionHelper.findField(SlotCrafting.class, "thePlayer", andSoOn);
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.