Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Zephan

Members
  • Joined

  • Last visited

  1. Where would I put a method that ticks during every world tick? I have a tile entity if that helps.
  2. I am trying to make a mod that has a block that affects the movement of a player when they are within a radius of the block. I have found some methods in the forge api, but I can't seem to get anything to work. My code accesses the net.minecraft.world.World methods as well as the net.minecraft.entity.player.EntityPlayer package to access nearby players. My code doesn't do anything, my guess is it just grabs null references for the player/world. I also think the block might not be affecting the player because the code might only run through one time when it is first instantiated into the world. Any thoughts would be helpful, here is the code. protected CustomBlock(Material p_i45394_1_) { super(p_i45394_1_); this.setBlockName("CustomBlock"); this.setCreativeTab(CreativeTabs.tabBlock); this.setHardness(50); this.setResistance(2000); this.setBlockTextureName(StringLibrary.MODID + ":dense_block"); this.setPlayerMovement(1.0D,1.0D,1.0D, 5.0D); } private void setPlayerMovement(double moveX, double moveY, double moveZ, double distance) { World world = Minecraft.getMinecraft().theWorld; TileEntityCamp camp = new TileEntityCamp(); if(world != null){ EntityPlayer player = world.getClosestPlayer(camp.xCoord,camp.yCoord,camp.zCoord,distance); if(player != null) { player.isDead = true; } }

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.