setting age value of END_GATEWAY

Discussion in 'Spigot Plugin Development' started by GamED, Jul 17, 2018.

  1. I am trying to create end gateway blocks without the beacon effect which from my research can be done by setting the age value of the block to a negative. However, I can't seem to find how to access and edit this value. I have looked through the Block API and the CraftBlock API and am not seeing a way to do this. Is this only possible using NMS code or am I missing something? If the former, how would I go about setting the age value?

    I am currently building against 1.12.2 but do intend to update to 1.13 once it's available. 1.12 solution is preferable but would love to hear what 1.13 has in store as well.
     
  2. You could try to edit the NBT data with this class. Should work for 1.8-1.12.2
     
  3. Not the block, the TileEntity. Get the TileEntity and you have access to it's age.
     
  4. This is something I looked at a while back and got stuck. Im better at programming now and came up with this https://github.com/Plugineers/Advan.../advancedportals/compat/CraftBukkit.java#L136

    As far as I know you can't disable the starting beacon as that likely is client side though the entity beacons are handled server side and this is by far the easiest way to handle it (the reset time is 3.4 years)

    Edit: I posted here as its the latest thing asking about disabling the beacons that I could find yet noone ever seemed to have an answer public that worked for as long as the question has been around

    AdditionalEdit: the method name is probably bad, its not really the age but rather the entity cooldown for the effect which is a separate variable but doesnt seem to have a name in forge, spigot or have any nbt tied to it.