Jump to content

sFXprt

Members
  • Posts

    68
  • Joined

  • Last visited

  • Days Won

    1

sFXprt last won the day on May 3 2023

sFXprt had the most liked content!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

sFXprt's Achievements

Stone Miner

Stone Miner (3/8)

2

Reputation

  1. make ur own methods
  2. 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
  3. 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
  4. 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?
  5. MinecraftServer#getLocalIP()?
  6. 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.
  7. I agree, and being able to set a fixed cost would be good as well.
  8. 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
  9. I made a mistake, Im currently not at an IDE right but can you just pass in ur Entity.get() thru ur init?
  10. 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.
  11. do you still need help, I can guide you on how to accomplish everything. Only thing I ask is next time you help others
  12. 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
  13. 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.
  14. It should run twice, it does logic on both sides.
  15. 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.
×
×
  • Create New...

Important Information

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