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.

Leaderboard

Popular Content

Showing content with the highest reputation on 12/02/21 in all areas

  1. you need to register a RenderType for your Block, call ItemBlockRenderTypes#setRenderLayer in FMLClientSetupEvent and use cutout as RenderType
  2. Thank you very much! With your Information I could get it to work ? For anybody interested, this is my code now. Mod class: import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; import net.minecraft.nbt.CompoundNBT; import net.minecraft.world.server.ServerWorld; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.WorldEvent; import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; // The value here should match an entry in the META-INF/mods.toml file @Mod(ModQuestion.MODID) public class ModQuestion { public static final String MODID = "questionmod"; private static final Logger LOGGER = LogManager.getLogger(); public ModQuestion() { FMLJavaModLoadingContext.get().getModEventBus().addListener(this::onClientSetupEvent); MinecraftForge.EVENT_BUS.addListener(this::onWorldLoaded); MinecraftForge.EVENT_BUS.addListener(this::onWorldSaved); } private void onClientSetupEvent(final FMLClientSetupEvent event) { //LOGGER.debug("Hello from the Client Setup!"); } public void onWorldLoaded(WorldEvent.Load event) { if (!event.getWorld().isRemote() && event.getWorld() instanceof ServerWorld) { MySavedData saver = MySavedData.forWorld((ServerWorld) event.getWorld()); if(saver.data.contains("MyData")) { LOGGER.debug("Found my data: " + saver.data.get("MyData")); //Do whatever you want to do with the data } } } public void onWorldSaved(WorldEvent.Save event) { if (!event.getWorld().isRemote() && event.getWorld() instanceof ServerWorld) { MySavedData saver = MySavedData.forWorld((ServerWorld) event.getWorld()); CompoundNBT myData = new CompoundNBT(); myData.putInt("MyData", 0); //Put in whatever you want with myData.put saver.data = myData; saver.markDirty(); LOGGER.debug("Put my data in!"); } } } WorldSaverData class: import java.util.function.Supplier; import net.minecraft.nbt.CompoundNBT; import net.minecraft.world.server.ServerWorld; import net.minecraft.world.storage.DimensionSavedDataManager; import net.minecraft.world.storage.WorldSavedData; public class MySavedData extends WorldSavedData implements Supplier { public CompoundNBT data = new CompoundNBT(); public MySavedData() { super(ModQuestion.MODID); } public MySavedData(String name) { super(name); } @Override public void read(CompoundNBT nbt) { data = nbt.getCompound("MyCompound"); } @Override public CompoundNBT write(CompoundNBT nbt) { nbt.put("MyCompound", data); return nbt; } public static MySavedData forWorld(ServerWorld world) { DimensionSavedDataManager storage = world.getSavedData(); Supplier<MySavedData> sup = new MySavedData(); MySavedData saver = (MySavedData) storage.getOrCreate(sup, ModQuestion.MODID); if (saver == null) { saver = new MySavedData(); storage.set(saver); } return saver; } @Override public Object get() { return this; } }

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.