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.

sFXprt

Members
  • Joined

  • Last visited

  1. does it print at all? Try printing old and new and see if the values are different, sometimes it might be block pos or actual view origin so it wouldnt be the same. If push comes to shove make your own old pos, compare to current pos then if not the same change old pos to new pos and do whatever
  2. I couldnt find a move event, maybe use PlayerTickEvent and check the old position and compare to new positon, if not equal then do whatever
  3. Hi, I'm currently trying to remake a spigot plugin called Custom Enchantments. Basically the only thing I'm trying to achieve is when I pickup an item in my inventory and hover over another item and swap with it I want it to cancel the swap and allow me to access both item stacks so I can transfer data from one another. Any ideas?
  4. MinecraftServer#getLocalIP()?
  5. Create a new abstractcontainermenu, attach a screen to it, override isValid to return true with given logic, then call the menu wherever you seem it is fit.
  6. I agree, and being able to set a fixed cost would be good as well.
  7. Create a method in ur custom item class with an entity as the parameter and call it at any event that handles ticks, check if that entity has the item in their inventory if so check if item is an instance of your custom item if so cast and call that method and in ur custom item class do ur logic there
  8. I made a mistake, Im currently not at an IDE right but can you just pass in ur Entity.get() thru ur init?
  9. https://github.com/Rinventor/SavedDataSync/blob/main/PTMSavedData.java#:~:text=(level)) {-,PTMSavedData data %3D PTMSavedData.getInstance(level)%3B,-return data. Whenever you are calling Client side code and want the server to do something with it you must send a packet over to the server and have the server do the logic there and if needed return any data changes back to the client. Not to be rude, but I really think you are over complicating everything and making it harder on yourself. Like mentioned above its really as simple as sending the data to server and if needed have the server send the data back to the client. Usually if the data you need to mess with is server side you don't need to send any data back.
  10. do you still need help, I can guide you on how to accomplish everything. Only thing I ask is next time you help others
  11. I went out of my way to debug it for you, I got the error to go away. Here is your final Code PrimedLumeniteTnt public class PrimedLumeniteTnt extends PrimedTnt { @Nullable private LivingEntity owner; public PrimedLumeniteTnt(Level level, double x, double y, double z, @Nullable LivingEntity igniter) { this(EntityInit.LUMENITE_TNT.get(), level); this.setPos(x, y, z); double d0 = level.random.nextDouble() * (double)((float)Math.PI * 2F); this.setDeltaMovement(-Math.sin(d0) * 0.02D, (double)0.2F, -Math.cos(d0) * 0.02D); this.setFuse(80); this.xo = x; this.yo = y; this.zo = z; this.owner = igniter; } public PrimedLumeniteTnt(EntityType<Entity> entityEntityType, Level level) { super((EntityType<? extends PrimedTnt>) entityEntityType, level); } @Nullable public LivingEntity getOwner() { return this.owner; } @Override protected void explode() { float f = 4.0F; this.level.explode(this, this.getX(), this.getY(0.0625D), this.getZ(), f, Explosion.BlockInteraction.BREAK); } } And here is where you register it public static final RegistryObject<EntityType<Entity>> LUMENITE_TNT = ENTITY_TYPES.register("lumenite_tnt", () -> EntityType.Builder.of(PrimedLumeniteTnt::new, MobCategory.MISC) .fireImmune() .sized(0.98F, 0.98F) .build(new ResourceLocation(Main.MOD_ID, "lumenite_tnt").toString())); I think what happened here is when you tried to extend your tnt class when in fact you should've just put <Entity> since PrimedTnt is extending Entity
  12. Its not happy with the constructor you currently have, delete it and when it suggests to create a constructor in the registry just create it there and see if it works. I wouldn't know what the correct constructor would be since I've never worked with PrimedTnt before.
  13. It should run twice, it does logic on both sides.
  14. This is a bit messy and could be implemented so much easier and cleaner. Just create your own AbstractContainerMenu at this point and have your own AbstractContainerScreen, make sure you override the stillValid() method in your Menu class and do whatever logic you deem necessary to keep that container open for that player.

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.