public static class MysteryBoxEvent.Open.Post extends MysteryBoxEvent.Open
MysteryBoxEvent.Open.Post, MysteryBoxEvent.Open.PreMysteryBoxEvent.Activate, MysteryBoxEvent.ComparatorPower, MysteryBoxEvent.Feed, MysteryBoxEvent.Open, MysteryBoxEvent.Tick| Constructor and Description |
|---|
Post(MysteryBoxTileEntity box,
net.minecraft.entity.player.PlayerEntity player,
net.minecraft.block.BlockState blockState,
net.minecraft.item.ItemStack itemStack,
long lastOpenTime,
long openUntil,
long nextOpenTime,
int scrapsTotal,
int scrapsLeft)
Fired when a Mystery Box has been opened, and its variables are being updated from that process.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getLastOpenTime()
The Unix time in milliseconds when this Mystery Box was last opened (in this case, right now).
|
long |
getNextOpenTime()
The Unix time in milliseconds when this Mystery Box can next be opened.
|
long |
getOpenUntil()
The Unix time in milliseconds until this Mystery Box will be open for.
|
int |
getScrapsLeft()
The new value of the counter for Netherite Scraps required to open this Mystery Box again.
|
int |
getScrapsTotal()
The new count of Netherite Scraps required to open this Mystery Box again.
|
void |
setLastOpenTime(long lastOpenTime)
Sets the Unix time in milliseconds when this Mystery Box was last opened.
|
void |
setNextOpenTime(long nextOpenTime)
Sets the Unix time in milliseconds when this Mystery Box can next be opened.
|
void |
setOpenUntil(long openUntil)
Sets the Unix time in milliseconds until this Mystery Box will be open for.
|
void |
setScrapsLeft(int scrapsLeft)
Sets the new value of the counter for Netherite Scraps required to open this Mystery Box again.
|
void |
setScrapsTotal(int scrapsTotal)
Sets the new count of Netherite Scraps required to open this Mystery Box again.
|
getItemStack, getPlayergetBlockState, getBoxpublic Post(MysteryBoxTileEntity box, net.minecraft.entity.player.PlayerEntity player, net.minecraft.block.BlockState blockState, net.minecraft.item.ItemStack itemStack, long lastOpenTime, long openUntil, long nextOpenTime, int scrapsTotal, int scrapsLeft)
box - The Mystery Box tile entity.player - The player instigating this event.blockState - The block state of this Mystery Box.itemStack - The item stack being used in this interaction.lastOpenTime - The Unix time in milliseconds when this Mystery Box was last opened (in this case, right now).openUntil - The Unix time in milliseconds until this Mystery Box will be open for.nextOpenTime - The Unix time in milliseconds when this Mystery Box can next be opened.scrapsTotal - The new count of Netherite Scraps required to open this Mystery Box again.scrapsLeft - The new value of the counter for Netherite Scraps required to open this Mystery Box again.public long getLastOpenTime()
public void setLastOpenTime(long lastOpenTime)
lastOpenTime - The last open time (ms).public long getOpenUntil()
public void setOpenUntil(long openUntil)
openUntil - The open until time (ms).public long getNextOpenTime()
public void setNextOpenTime(long nextOpenTime)
nextOpenTime - The next open time (ms).public int getScrapsTotal()
public void setScrapsTotal(int scrapsTotal)
scrapsTotal - The total scraps required.public int getScrapsLeft()
public void setScrapsLeft(int scrapsLeft)
scrapsLeft - The value of the scrap counter.