#help-development
1 messages · Page 700 of 1
Oh yeah i used mojangs itemstack
ItemStack item = player.getInventory().getItemInMainHand();
watch kody's tutorial, you're probably serializing yaw in a wrong way (Im not sure).
Thats why its want working
this btw work
nice
thank you very nice ❤️
i just asked chatgpt breh
get nms inventory, and methods should be the same
but why you need that?
for what?
to get items in chat
ItemStack stack = new ItemStack(player.getInventory().getItemInMainHand());
TextComponent component = new TextComponent();
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_ITEM, ItemContent.from(stack)));```
get the bukkit itemstack
and mirror it as nms itemstack
or just get the handle field (if itemstack is a CraftItemStack)
So I don't see any issue here, nvm
yeah cuz the text component is empty
Finally full done of this plugin for my server
thats p cool
Yooo how did you do 3d.. Armor?
Backpack
it’s armor stand that follow you
I think it's working a bit with lags?
item with custom model data?
Or CIT
I mean it’s HMC Cosmetics plugin and its work fine for 100+ players with other heavy plugins like custom blocks, mobs etc without bigger issues so I think it inst that bad
somehow it’s optimised, idk how but if its work well without issues
yes it’s pretty much just item with cmd
any1 know how do it fix
Required type:
Objective
Provided:
ObjectiveArgument
and
Required type:
FriendlyByteBuf
Provided:
Score
nah I want to make as much feels like moded server without need to use any mods, even optifine, so players ca join, download resource pack and have fun
Does someone know if you can spawn a block display and set a state to interpolate to in the same tick, because when I try that it instantly goes to the 2nd stage without an animation. Delaying setting the state to interpolate to by a Bukkit runnable works tho (kinda dont want to tho). Ty for the answer in advance.
use the spawn method with a consumer
why intellij so dumb
nvm im dumb it returns previous value 😄
not the current one in the map lol
Yeah usually you're the wrong one if you think IntelliJ is dumb 
i mean sometimes it really false flags
it usually with custom boolean getters
and then it complains that value is not checked
while using object getter after checking the boolean value from the method
and it makes sense because it doesnt know that the boolean getter method is somehow connected to the object
but in that case i would like to be it less agressive
what should I do
dont really understand why it works but nice that it does. Ty
Edit: kinda unreliable tho, sadly. (Works 1/3 cases, randomly)
now its really dumb
configurer.getName() returns a nullable
it throws warning for it
but it would get checked anyways in the .addCommandCategory() method above
intellij is too agressive on warnings sometimes
bro what
do not say "too agressive on warnings"
it's literally a runtime error vs. a helpful squiggly to remind you something may be wrong
and yeah no IDEA does not recursively check each method for assertions, that's ridiculous
I mean it can still fail if you call the second method manually
nvm
i read it wrong
but still I agree with dominick
a char code couldnt have this many colors anyways
Huh? You can colour characters any way you'd like
well I just mean with the vanilla resource pack/font
?paste
Anyone know why this wouldn't work?
I've tried debugging, checking console for errors, etc and can't find any reason why no particles are spawning
The event itself doesn't seem to be called at all
so its not prining any of the debug messages to console?
if so
make sure you registered listener
and make sure you did the @EventHandler annotation
It is registered and had the annotation
omg
it didnt have an annotation
wow
ty for the help
lmao
Anyone knows the problem why my ServiceManager is not registering on time or in order?
Main.java (onLoad)
this.api = new API(); // API implements InterfaceAPI
this.getServer().getServicesManager().register(InterfaceAPI.class, this.api, this, ServicePriority.High);
Main // plugin.yml
name: MainPlugin
version: '${project.version}'
main: xyz.apollo30.arcane.Main
api-version: '1.19'```
**SecondMain.java** (onEnable)
```java
ServicesManager servicesManager = plugin.getServer().getServicesManager();
if (servicesManager.isProvidedFor(type)) {
RegisteredServiceProvider<T> provider = servicesManager.getRegistration(type);
if (provider == null) return;
this.service = provider.getProvider();
plugin.getLogger().info(String.format("Successfully hooked into %s!", name));
} else {
plugin.getLogger().severe(String.format("Could not hook into %s. This may cause major errors in the plugin.", name));
}```
**SecondMain // plugin.yml**:
```yml
name: SecondPlugin
version: '${project.version}'
main: xyz.apollo30.arcane.SecondMain
api-version: '1.19'
depend:
- MainPlugin
MainPlugin is a dependency for SecondPlugin and it does load before it but I can't seem to fetch the registered service manager in the second plugin?
Anyone knows what's up?
doesn't look like it no
oh it probably is, one second
Yep that solved it, turns out I forgot to add the scope to provided.
Not sure why it's like that, but yeah thanks for the help.
event get called on this line
then how it going to check from next line if the event is cancelled or not?
but it get called already before cancel.
like if I do any task with the custom event, it wouldn't check if the custom event cancelled or not
Excuse me?
Do you know how the system works?
You call the event
And let listener change the variables etc.
Then you handle the changed information
let me introduce you to AsyncPlayerChatEvent
https://paste.md-5.net/ujifuviguy.cs
The resetPortalFrames isn't working properly, I mean it doesnt work at all.
My intention was whenever a player used all of his eyes the frames should get a reset or override it by new frame blocks, I tried that but It doesn't really work.
As said in #general, add some log lines in your interact event and resetPortalFrames code. However, with that intention you just gave, that's not going to work. You're storing a global count for eyesUsed, meaning every player contributes to that counter whenever the interact event fires. Say you and another person throw one eye each, your listener will have eyesUsed = 2, not eyesUsed = 1 for both of you. You're going to need to use some sort of data structure (like a map or something) to map UUIDs to eyesUsed and check how many eyes each player has used that way.
Anyway the log lines will hopefully shed some light on what's going wrong, as your code should "work" -- but it won't work the way you're currently intending based on your description
oh alright, I got it now. Thanks I really appreciate it.
Sure thing
Ofc there are exceptions
My world name was corrupted, that's why it didn't work lol
it was paper_and some numbers idk
and I have changed it by UUIDs that helped, thanks
E
Anyone know why maven throws these warnings and how to fix them?
because those versions won't be compatible with maven 4 anymore, the warnings should be gone if you update them to the latest versions
you can also set maven.plugin.validation to NONE
is it possible to add a value at the end of the chain of tab completion? meaning that it would append to the list of any list of player list in a autocomplete tab, the idea is to add, for example "test" to every plugin trying to autocomplete the playerlist
I think you can do that with Player#addCustomChatCompletions()
the thing is it would need to have the lowest possible priority, run last, right before sending to the player
to append to the custom lists made by plugins
I did that with the maven-shade-plugin, but I can't seem to find any uses of the other plugins in my poms. (Minus special source. I need both versions)
the compiler plugin and resources plugin are inherited from the "super pom". you can either just set a version yourself without any configs, or disable the validation
though IIRC maven-resources-plugin, latest is 3.3.1 so probably not a big change lol
What's a super pom?
that is the pom that every project inherits automatically
e.g. the one that defines the central repo
How would you set the version without any configuration aspects?
why do you need two specialsource plugins?
Multiversion
<build>
<plugins>
<plugin>
<groupId>...</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
...
without modules? 🥲
It's multi module, but I'm using the specific version of special source that released with the version of MC in the appropriate module.
the latest specialsource plugin usually works with all versions
at least for me that always worked. I just always used 1.2.2 lol
but yeah I'd just set the validation to NONE, it complains about many latest builtin plugins too sooo it's kinda pointless
I use different versions beacuse I had issues with 1.17. I don't care what anyone says, 1.17 was a scuffed release and the tooling was not on my side.
You'd think people would just update the plugins when maven 4 releases.
maven 4 will break many things anyway
no more system scope 🥳
at least not to files within the project dir
Automatic parent/dependency versioning
Finally
What is DirectMethodHandler error
hi, everybody, I've got a problem. Компилирую плагин через gradle, никаких ошибок нет. В build.gradle все зависимости есть
build.gradle:
dependencies {
implementation 'org.luaj:luaj-jse:3.0.1'
compileOnly "org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT"
}
but when the plugin is run on a minecraft server it causes this error:
[10:12:11 ERROR]: Error occurred while enabling MLua v1.0 (Is it up to date?)
java.lang.NoClassDefFoundError: org/luaj/vm2/lib/jse/JsePlatform
at org.smokingplaya.mlua.MLua.onEnable(MLua.java:32) ~[?:?]
java class:
package org.smokingplaya.mlua;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
import org.luaj.vm2.Globals;
import org.luaj.vm2.LuaValue;
import org.luaj.vm2.lib.jse.JsePlatform;
public final class MLua extends JavaPlugin {
@Override
public void onEnable() {
Bukkit.getConsoleSender().sendMessage("that works");
String script = "print('hello, world', _VERSION)";
// create an environment to run in
Globals globals = JsePlatform.standardGlobals();
// Use the convenience function on the globals to load a chunk.
LuaValue chunk = globals.load(script, "maven-exmaple");
// Use any of the "call()" or "invoke()" functions directly on the chunk.
chunk.call();
}
}
what should I do?
you should shade the library into your plugin
how?
@teal wagon @chrome beacon You guys are the best! Thank you so much! I was up all day yesterday trying to figure out what was wrong and how to do it right.
is this:
sorting-types: '[GROUPS:owner,developer,admin,default]'
same as this in yml ?:
sorting-types:
- GROUPS:owner,developer,admin,default
like this :?
['GROUPS:owner,developer,admin,default']
Yes
which repository does bStats belong to?
Maven central
Im trying to implement AdvancedBan but this happens
https://paste.md-5.net/orafamariq.rb
no im trying to implement a plugin
compileOnly 'com.github.DevLeoko:AdvancedBan:v2.3.0'
i only got this
but bstats error
leoko plugins are on
maven {
name = "leoko-dev"
url = "https://repo.leoko.dev/releases"
}
do you have this in your build.gradle?
no idea, didn't used bStats over 2 years, all of my plugin are private
but the last time i used bStats it was a class to use in the project
try implementing the class instead of using gradle or whatever
A description on how to include bStats to your plugin
Bstats 1.5 aye? Pretty sure in those days it was just a class but nowadays u need ur plugin I'd too
Id
add dependancy, shade it, make new instance with your plugin id you get from the website
?paste
https://paste.md-5.net/tihicexoku.cs
This code does not give any error to the console. What it needs to do is run a method that will save the locations of the blocks that are placed and broken later and delete them. It saves locations and can delete and replace blocks whenever I want. But when I break a block I put myself, it puts it back in its place. How do I prevent this?
What do you mean by that?
But when I break a block I put myself, it puts it back in its place
Let me explain it this way. I want to reset a specific field. Players can block or break. But if I type a command like /map restart. The area should be restored, that is, the broken blocks must be restored and the laid blocks must be deleted.
If I put a block and break it, when I type /map restart that block comes back. I don't wanna this.
Then only track the very first time a block gets altered. This way you will always have the original in your map.
Sorry, I didn't fully understand that. Can you explain this a little more?
So you want to have an area which can be restored after players are done playing in it, right?
Then start by creating some Map<Location, BlockData> where you can store blocks.
Now if a block gets changed for the first time by events like:
- BlockBreakEvent
- EntityExplodeEvent
- BlockFromToEvent
etc. -> You store the block in theMap<Location, BlockData>.
But after a block has changed once (for example if someone breaks a grass block) you dont save the data
if the block changes again (for example if someone places another block there).
So before adding something to your map, you simply check if this location is already filled with original
block data. If it is then you dont overwrite this data.
If you use Collection<Object> as a parameter and do manipulations to the objects in that collection, would a list passed into the method retain it's ordering if the list itself is not changed, and iteration happens with a for(Object o: loop?
Generally speaking a collection does not change its order if the state of their elements are mutated.
But there are only a few collections which have an order in the first place. Sets for example are by definition unordered.
lright
Also relevant though for a completely different reason, does bukkit have any internal methods for vector math? I need to rotate a set of locations that 'point' towards 'north' by yaw and pitch
*around a specific point, not around 0,0,0
Yes, you can rotate a vector around any axis
?jd-s
well the axis for the second rotation changes with the first rotation doesnt it? Thats kinda why i asked if bukkit has some internals for that, i do recall java having vectors
declaration: package: org.bukkit.util, class: Vector
I'm not sure how to obtain the second rotational axis
What are you trying to rotate?
a set of particles to align with player vision
the first rotation makes it so the second rotation axis no longer is a unit vector a la two 0 one 1
I dont recall the operation to obtain the correct secondary rotation axis
A rotation doesnt change the lenght of a vector...
i rotate by pitch and yaw. I can do either by rotating around 0,1,0 or 1,0,0, but the OTHER rotation axis changes if i do the first rotation
i need that second axis
What do you mean the other rotation axis changes?
You can rotate around 0,1,0 and then around 1,0,0
if you have a single vector, yes
*maybe
but if you want to rotate a bunch of stuff, the projection gets warped if you do that
the second rotation axis is perpendicular to y and the rotated vector
intellij became shit when it updated to the latest version what the fuck. Any idea how to enable autosave?
autosave?
yes
intellij always saves almost immediately
no
idk what u have done then
actually that axis is probably either the dot or cross of the 0,1,0 and the rotated vector lol
nvmind
intelji now freezes frequently
havent had issues with that just yet
you update last version?
You are freezing one degree of freedom. You dont have a roll.
I dont see the problem. Otherwise i would have suggested using qaternions or a rotation matrix for this.
if yes, then try to copy the name of material and paste and find out
ah
i need to rotate around both
to move a image thats projected 'north' to align with the player vision
i said AND not OR
also
pitch and yaw cause roll if you rotate 1,0,0 and 0,1,0 instead of the secondary shifted rotation
yea
not sure what u mean by that
Just use a rotation matrix then
public class BlockRestorer {
public static Map<Location, BlockData> originalBlockData = new HashMap<>();
public void storeOriginalBlockData(Location location, BlockData blockData) {
originalBlockData.put(location, blockData);
}
public BlockData getOriginalBlockData(Location location) {
return originalBlockData.get(location);
}
public void clearOriginalBlockData(Location location) {
originalBlockData.remove(location);
}
public boolean hasOriginalBlockData(Location location) {
return originalBlockData.containsKey(location);
}
public static void restoreBrokenBlocks() {
for (Map.Entry<Location, BlockData> entry : originalBlockData.entrySet()) {
Location location = entry.getKey();
BlockData blockData = entry.getValue();
if (location.getBlock().getType() == Material.AIR) {
location.getBlock().setBlockData(blockData);
originalBlockData.remove(location);
}
}
}```
```java
@EventHandler
public void onBlockBreak(BlockBreakEvent e){
blockRestorer.clearOriginalBlockData(e.getBlock().getLocation());
e.getBlock().setType(Material.AIR);
}```No broken blocks are renewed anymore 😃 What did I do wrong?
- Make your map private, and non-static
- Make the
restoreBrokenBlocks()method non-static - Modifying a map while iterating over it will cause a ConcurrentModificationException
- Show the rest of the code
Also: This if clause will cause a ton of trouble. I dont see the logic behind it really...
public static void restoreBrokenBlocks() {
for (Map.Entry<Location, BlockData> entry : originalBlockData.entrySet()) {
Location location = entry.getKey();
BlockData blockData = entry.getValue();
if (location.getBlock().getType() == Material.AIR) {
location.getBlock().setBlockData(blockData);
originalBlockData.remove(location);
}
}
}
should be just
public void restoreBrokenBlocks() {
for (Map.Entry<Location, BlockData> entry : originalBlockData.entrySet()) {
Location location = entry.getKey();
BlockData blockData = entry.getValue();
location.getBlock().setBlockData(blockData);
}
originalBlockData.clear();
}
Config.set
Throw it in a FileConfiguration
Ok
They need to be registered?
Yeah
The rest of the code:
@EventHandler
public void onBlockBreak(BlockBreakEvent e){
blockRestorer.clearOriginalBlockData(e.getBlock().getLocation());
e.getBlock().setType(Material.AIR);
}```
```java
public boolean onCommand(blah blah){
//... blah blah again
if(args.length == 1){
if(args[0].equalsIgnoreCase("restart")){
for(Player players : Bukkit.getOnlinePlayers()){
players.sendTitle(Utils.color("&6&lEvent Restarting..."), Utils.color("&eYou Are Teleporting"), 10, 20, 10);
new BukkitRunnable(){
@Override
public void run(){
}
}.runTaskLater(plugin, 20 * 2);
}
restoreBrokenBlocks();
clearPlacedBlocks();
}
}
}```
```java
private static Map<Location, Material> placedBlocks = new HashMap<>();
public BlockPlaceListener(RestartMap plugin) {
this.plugin = plugin;
}
public static void clearPlacedBlocks() {
for (Location location : placedBlocks.keySet()) {
location.getBlock().setType(Material.AIR);
}
placedBlocks.clear();
}
@EventHandler
public void onBlockPlace(BlockPlaceEvent e){
placedBlocks.put(e.getBlock().getLocation(), e.getBlock().getType());
}```
Also, after doing what you said, intellij gives 2 errors.
1st : `Cannot resolve method 'restoreBrokenBlocks' in 'EventCommand'`
2nd: `Non-static field 'originalBlockData' cannot be referenced from a static context`
Havent used this in forever.
- Create an instance of BlockRestorer in your JavaPlugin class (only 1 !)
- Pass this instance through the constructor of every other class which needs this instance
This is called dependency injection.
You should try to write your next plugin without using the static keyword, at all.
It should be rarely used anyways.
I'm sorry for not understanding many things and asking questions all the time, but what exactly do you mean by instance, what do you want me to do?
public class PluginName extends JavaPlugin {
private BlockRestorer restorer;
@Override
public void onEnable(){
restorer = new BlockRestorer();
}
}
🤦
So how do I use that Serialization stuff
be ashamed
A class is just a blueprint which describes functionality. It can do nothing on its own. You cant call anything in it and dont use its variables.
If you want to use it you need to create an instance of this class. This means you 'build' or 'construct' an object using the new keyword.
BlockRestorer someVariable = new BlockRestorer();
BlockRestorer blib = new BlockRestorer();
This code snipped created two instances of your BlockRestorer class.
They each have their own methods, own maps and are completely independent from each other.
Actually, I have a little knowledge of these, but when someone says "do instance" to me, I can't understand what to do.
Thank you
Also you are so handsome
😃

I got a question based on an Scp (Scp-294 or the coffee machine), its possible to pull of all the possible material in existence and give them something they do like in the wiki is written “anti-water” and pull it off inside the game or any other real life material as a water bottle and give them effect based on the name
yes if you make it ofc
But in order to use it in other classes, shouldn't I make it public static instead of private? Now I deleted the BlockRestorer variables that I created in other classes and nothing changed 😄
But how using ai only that’s my only idea
Guys Is there any plugin that if a player sends a Chat the nearest player will be the only one to read it and so the other players who's far off from the Player who Sends the chat it will not be visible
then do it
But never worked with ai and java is probably not the best for it
then learn how to work with ai

You need to pass this instance around. Every class needs to store a variable which contains this instance.
This should be done in their constructors.
For example
public class RestoreListener implements Listener {
private final BlockRestore restore;
public RestoreListener(BlockRestore restore) {
this.restore = restore;
}
@EventHandler
public void onPlace(BlockPlaceEvent event) {
Block block = event.getBlock();
Location location = block.getLocation();
...
if(!this.restore.hasOriginalBlockData(location)) {
this.store.storeOriginalBlockData(location, block.getBlockData());
}
}
}
I did this class but I have to shyly ask something. What are we doing now? 😄 Initially the ide was not giving an error, and was just tiling a block that didn't need to be tiled. Now IDE 3 is throwing an error and nothing is working.
||Please don't write too long, I feel guilty when you write me long texts||
You need to overhaul quite a bit of your plugin if you abused static before and are now switching to proper dependency injection.
You onEnable might need to be updated to something like this:
public class RestorePlugin extends JavaPlugin {
@Override
public void onEnable() {
BlockRestore restore = new BlockRestore();
BlockRestoreListener listener = new BlockRestoreListener(restore);
BlockRestoreCommand command = new BlockRestoreCommand(restore);
Bukkit.getPluginManager().registerEvents(listener, this);
getCommand("restore").setExecutor(command);
...
}
}
And no worries, we are in this channel to help. If i get bored i can just leave 
So remove all the static methods and variables and replace them all with calls on an actual instance of a class.
tensorflow is available for java, so why not
I guess the errors are not related to that. Errors: Cannot resolve symbol 'blockRestorer' & Cannot resolve method 'restoreBrokenBlocks' in 'EventCommand' & Non-static field 'originalBlockData' cannot be referenced from a static context
Those are all errors that indicate that you are still missing quite a few things in your listener and command classes.
Mainly the fields that store your BlockRestore
Lets see them
I did what you said in classes with errors
There is no change in the old errors, but the new ones are as follows: Variable 'plugin' might not have been initialized & Variable 'restorer' might not have been initialized & Cannot resolve method 'restoreBrokenBlocks' in 'EventCommand'
Show the classes pls
?paste
okay please check dm
private final RestartMap plugin;
private final BlockRestorer restorer;
public EventCommand(RestartMap plugin, BlockRestorer restorer) {
this.plugin = plugin;
this.restorer = restorer;
}
Change what you have to this.
Well, is there a solution to other errors?
Cannot resolve method 'restoreBrokenBlocks' in 'EventCommand'
Non-static field 'originalBlockData' cannot be referenced from a static context
restoreBrokenBlocks(); -> this.restorer.restoreBrokenBlocks();
oh okay
And the second one is from a different class i assume
I think i can imagine the problem
Your method is still static

This will show another problem. I think you can solve that
only problem I see is using locations instead of blockvectors or whatev
The IDE is not giving any errors now
Probably goin on keywords like molten etc to understand what item because on the wiki is written that some material can give an error to the machine or if they are not found in a radius in realities or the current world
I'm really ashamed to say this, but the situation is still the same. The blocks I break do not come back.
show code
BlockRestorer: https://paste.md-5.net/esicanohav.cs
public class BlockBreakListener implements Listener {
private final BlockRestorer restorer;
public BlockBreakListener(BlockRestorer restorer){
this.restorer = restorer;
}
@EventHandler
public void onBlockBreak(BlockBreakEvent e){
restorer.clearOriginalBlockData(e.getBlock().getLocation());
}```
```java
@Override
public boolean onCommand(blah blah){
...
this.restorer.restoreBrokenBlocks();;
}```
help who has a tutorial or piece of information related to the topic of schematic file regeneration
1 you could use worldedit api or 2 you could make a custom schematic file system
Bukkit already has schematics
besides that there is regions
I have a whole lib for this
thf
there is everything related to the regeneration of the schematics?
uhh
Just unload and re-paste
It doesn't really "regenerate" them as much as it just nukes everything
oh
otherwise you have problems with entities and weird blockstates
everything is much easier than it seemed lol
does the automine connected with trees also work?
no clue what you're on about at this point
bruh translate sack
this traslate really sack
and the plugin for the auto mine where the trees appear also regenerate so?
at me.powerbutton.stuff.Stuff.checkForPluginSizeAndRestart(Stuff.java:136) ~[Stuff-1.0-SNAPSHOT.jar:?]
at me.powerbutton.stuff.Stuff.lambda$onEnable$0(Stuff.java:93) ~[Stuff-1.0-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.1.jar:git-Paper-84]
at org.bukkit.craftbukkit.v1_20_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:480) ~[paper-1.20.1.jar:git-Paper-84]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1480) ~[paper-1.20.1.jar:git-Paper-84]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.1.jar:git-Paper-84]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1394) ~[paper-1.20.1.jar:git-Paper-84]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1171) ~[paper-1.20.1.jar:git-Paper-84]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[paper-1.20.1.jar:git-Paper-84]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: me.powerbutton.stuff.RestartReason```
this is what happens when i use enum, but when i changed the restartreason to be strings it worked okay
is that the full stacktrace?
yes
well then the .jar doesn't include that file
open your .jar, see if it's actually there
i decompiled it and its there
in the same .jar?
?whereami
are you referencing the class in onEnable the first time?
If yes, the classloader won't load new classes anymore
I mean in onDisable()
in onDisable you cannot load new classes anymore
nah my disable method is empty
then show your Stuff class
thats the main class
yes
?paste
how does Utils look like
why in the frick is utils a non static class
add a field to your main class
private static final RestartReason DUMMY_RESTART_REASON = RestartReason.SCHEDULED;
that should fix it
got it
also if interested this is the utils class
https://paste.md-5.net/qajavadoqe.java
that did not fix it it looks like
?whereami
i do not recognize spigotmc
did you just nerd md
and roles cache is still broken
leave and rejoin
nah
yah
nuh uh
yuh uh
nuh uh
yuh uh
yuh uh
are we friends now message digest five?
this is not one of these times
how can we know tho?
you just know
hey
So there arent cases like “your moms server”
Instead of “your moms” server
your mom's server
is there an event for when item gets added to inventory?
no
I have made one before
yaay my PR for the mvdev plugin was merged
oh merging it such an as**le working. I always broke things merging
then you're doing it wrong lol
yeah, any recommendations? i Mean if i dont disturb you of course
usually merges work 100% automatic unless the file was changed after the PR was opened
Most of the time when im merging 2 branch togethers, it opens lost of issues related to same files changed
if they don't, then you'll be shown an editor with a bunch of >>>>>>>>>>>>>>>>>>> lines and you'll manually have to merge it, then remove all those "merge" lines
that's called a merge conflict
yeah i always have them
that can only happen if you edit two branches at the same time or if the target branch has been changed after the pull request was opened
oh right
does any1 know if its possible to "speedup" certain tile entities easily? say hoppers for example?
there's settings for hoppers in bukkit.yml or spigot.yml
that's not possible, they get ticked when they get ticked. IIRC the server loops over all TileEntities every tick and then if it's a hopper, does the hopper logic if the current tick number is dividable through the hopper speed or sth like that
I mean you could ofc manually loop over them and manually cause them to update
the NMS hopper should have a tick() method that oyu can call
pretty sure it just counts down an integer which spigot then sets to whatevers been set in its config after the hopper logic
yeah but it doesnt do that for each individual hopper
thats probably the only way then yea
possibly
hm looks like cooldownTime is stored per hopper, not globally
so you could try to set it for individual hoppers
it's in TileEntityHopper
ah yea i did think so wasnt sure
though after each iteration of its logic, spigot will set it no?
probably. I have only checked the craftbukkit code, which uses the hardcoded values and the pushitemsTick method seems to be unused
didnt you also have a post on using remapped spigot?
?nms
yea pretty sure it is
it will check its time stuff every tick and then it calls that
il go and see if i can hammer something feasable out. thanks for the insight
good luck!
I just wanted to make a ping check
using keep alives
but for some reason the client doesn't really respond to them
well yeah, usually it goes the other way around
the client sends a keepalive that the server responds to
oh, hm, minecraft does it the other way around :thonkhmm:
looking for coders to help with develepment on a new project
what project
make a compleate plugin has everything a server could ever need in
lol
i love playing on template.server.mc
did that already
an entire sever in 1 plugin is a bad idea
Make it so that this plugin can run other plugins in it
make a plugin that has a gui where you set your setup type and it downloads shit for you
i created a command that spawns a entity i add that enitity into a variable and now i want to give the player a reward whoever kills it ofc that can be done by Entitydeathevent so how can i accsess that variable onto that event class
pdc
how does pdc will help
You give the entity a pdc tag
you mean i can store a key to that entity and how do i accsess to another class ?
And in death event check if ot has that tag
can u help me with taht pwease : )
That’s what I’m doing except through a website
Ex you can enable spawn npcs and choose a spawn and it auto sets everything up
?pdc
hey
Look at 7smile7's example and then look at what you have
Or if you really care, change your listeners to put your old block data onBreak and onPlace
how do i stop the vanilla mining animation in a BlockDamageEvent? i want to replace it with a custom one, do i just cancel the event
i think mining fatigue -1 works but im not sure how ill give it before the actual animation pops up
i want to make custom mining
or: Why you should NEVER use NBT tags again! Spigot 1.14.1 added the biggest improvement that (in my opinion) ever made it into the Bukkit API: The Persistent Data Container (PDC). It can be used to store custom data on Entities, TileEntities, and ItemStacks. Using a bit of math, it can also be used to...
you aren't the only one
ideally you give it permanently and rewrite all the block breaking logic
I remember doing what he said
basically you can just create a NamespacedKey in your main class, e.g. "is-my-custom-entity" as public final field. Then when you spawn the entity, you apply this with a random value, e.g. string or byte (or boolean when on 1.20), and when the entity dies, just check if it has that tag
or with a getter ofc
whatever
i really dont want to mess with the other blocks breaking logic
ill figure it out ig
ty tho
what to add in itemmeta so my listener can later recognize this item and it wont be visible in game
or: Why you should NEVER use NBT tags again! Spigot 1.14.1 added the biggest improvement that (in my opinion) ever made it into the Bukkit API: The Persistent Data Container (PDC). It can be used to store custom data on Entities, TileEntities, and ItemStacks. Using a bit of math, it can also be used to...
is it okay to update an scoreboard every 5 seconds?
yes
right, i mean because i dont cause server issues related to executing too many tasks and made it really periodically
one more q, what are attribute modifiers and item flags used for?
attribute modifiers change attributes, like generic armor, movement speed etc.
item flags are self explanatory, e.g. HIDE_ENCHANTMENTS will hide the enchantments, etc
ok tysm
Hi! I need some help figuring out why my plugin doesnt detect this PiglinBrute entity.
Error: Caused by: java.lang.NullPointerException: Cannot invoke "com.dumbllama.halalboxcustombosses.mobs.Hellboss.getInstance()" because "this.hellboss" is null
Where I need to detect it:
private HellBossManager bossManager;
public Hellboss hellboss;
PiglinBrute mob = hellboss.getInstance().boss;
private int timeLeft = 10;
public BossKilledTask(HellBossManager bossManager){this.bossManager = bossManager;}
I declared it here: (Different class)
private Hellboss hellboss;
public Hellboss getInstance() {
return hellboss;
}
public PiglinBrute boss;
public void Spawnmob(Location loc, HalalBoxCustomBosses plugin){
boss = (PiglinBrute) new MobSpawn("§c§lHell Boss",500, EntityType.PIGLIN_BRUTE).spawn(loc);
boss.getPersistentDataContainer().set(hellBoss, PersistentDataType.BOOLEAN,true);
boss.setAdult();
boss.getEquipment().setItemInMainHand(weapon);
boss.setAI(true);
boss.setImmuneToZombification(true);
boss.setRemoveWhenFarAway(false);
boss.setNoActionTicks(5);
boss.setNoDamageTicks(10);
boss.getAttribute(Attribute.GENERIC_FOLLOW_RANGE).setBaseValue(100);
boss.getAttribute(Attribute.GENERIC_MOVEMENT_SPEED).setBaseValue(.63);
boss.getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE).setBaseValue(10);
boss.getAttribute(Attribute.GENERIC_ATTACK_KNOCKBACK).setBaseValue(5);
boss.getAttribute(Attribute.GENERIC_ATTACK_DAMAGE).setBaseValue(5);
Well if you dont write something in your hellboss field then it will contain null...
In a different class I declared the hellboss.
That just means your code ran before you set the field from outside.
PS: Never make your fields public.
Just a note you can use ChatGPT for free and it'll literally create codes for you and fix your code, you can also have it completely explain in great detail how the code works. May help some
Ok. Still no reason to make it public.
I just realized I created an instance for the class xD
It will also spit out an incredible amount of garbage and outdated code because of its ancient dataset.
Not a good tool for spigot at the moment.
You can have it use updated code you have to be precise in exactly what you want
So how would you pass the mob to a different class so it won't return null?
Its missing context because the dataset is from a few years back and will not have sufficient knowledge about
the latest API state. You can give it as updated code as you want. It wont have enough background knowledge for
quite a few code problems.
it'll frequently come up with with total shit code though
Create a custom mob manager which maps spawned spigot mobs to your custom mob classes.
Something like a
public class CustomMobManager {
private final Map<Entity, CustomMob> spawnedCustomMobs = new HashMap<>();
public void handleInteraction(Entity entity, Player player) {
CustomMob customMob = spawnedCustomMobs.get(entity);
if(customMob == null) {
return;
}
customMob.interact(player);
}
...
public void handleDeath(Entity entity) {
CustomMob customMob = spawnedCustomMobs.remove(entity);
}
}
Then you create one instance of this manager in your onEnable and pass it
to your listener and command classes.
so even if there's one mob at a time you'd still recommend using this?
What if you decide to use this system to spawn little minion mobs for your boss?
You wouldnt want to rewrite your code for that.
Hmm yeah, that's a good point. Does a projectile also counts as entity?
yes
But i wouldnt classify it as a custom mob
I would probably create a dedicated custom projectile manager for that 😄
Cool, I'll try this method.
Can you recommend a udemy course for spigotapi?
Take a course in Java first
i doubt a udemy course exists, learn java first and learning spigot will take a few days
Wasnt there a guy that made bank with a spigot course?
idk
Yeah pretty sure
I wonder if it's any good though
I'd never pay to find out
What method makes an entity glow?
https://www.digminecraft.com/effects/images/glow.png
I still don't get why a List<?> is not considered to be a List<Object>
cuz variance
variance?
if I can loop over it like that, then why can't I declare it to be a list<Object>
oh yeah I couldn't add anything to the list
makes sense now
because that's the upper bound, but you don't know the exact type the list is holding
Just add a glow potion effect?
Effect glowing
which is why you can't add elements to the list (except for null :^) ), because you don't know what exactly it's holding, you just know you can get {upper bound type}s out of it
i find contravariance to be handled very weirdly in java to be honest...
Entity#setGlowing(boolean)
Got it!
Anyone know how to change the glow color?
is potion effects better usage of api?
Glowing potion effect
Glowing entity effect
❌ setGlowing
Thats literally the one way to not make it glow
why
Okay I'll search around for the others
Because it does refers to an entity property and not the glowing effect
ye but it does make it glow
i have a problem when trying to get a declared field using reflection
Field dimensionsField = Entity.class.getDeclaredField("dimensions");
but this field exists
Is this the obfuscated name? Are you using mojang mappings?
im using paper weight
deobfuscated mapping
it doesn't
yes
Then the runtime name might as well be something completely different.
Like "k"
my problem is i get NoSuchFieldException
Remapping reflections would be wild
but i know this field exists
use the obsfucated name
but it isn't called that
ok
i have another question
I'm gonna set entity AI by CompoundTag
this will work?
you are very helpful thanks
Why not via the available methods?
what methods?
setAI(false)
if it's an object you can edit it, if it's ? you can't
is that exists??
xD
i didn't know it
i think you should check the javadocs before using reflection
i googled it but only found nms one
but stilll you can just wipe away all the dev's work by setting the list to raw
and it'll work
omg im dumb
declaration: package: org.bukkit.entity, interface: Entity
you can do ctrl f and search the method
I'm creating a plugin for summoning tiny and huge mobs
or just use the brower and search for Entity.setAI
found it
Mobs cant really be scaled, can they
no they cant
i searched for that a lot back then
but except april fools snapshot
i dont know if spigot api has that
Do you happen to know which EntityEffect will yield my desired result?
Glowing probably
Don't see any with glowing
why not?
glowing doesnt exist
EntityDimensions entityDimensions = (EntityDimensions) dimensionsField.get(nmsEntity);
EntityDimensions scaledDimensions = new EntityDimensions(entityDimensions.width * s, entityDimensions.height * s, entityDimensions.fixed);
Because minecraft doesnt support that internally
Use the potion effect
i still dont get why not just Entity.setGlowing 😐
Because tinkering with the color requires teams
This will just mess up the hitbox
based on nms.screamingsandals.org/1.20.1/net/minecraft/world/entity/Entity.html the obfuscated name is "bh"
is it right?
yea
its just a fun plugin i think no one would care
like can you see the change with f3+b?
how?
can you send the method for me?
thank you
How do you apply a potion effect to an Entity? I know you can do it to a LivingEntity, however I don't see any methods that allow this for an Entity.
Just do an instanceof check
there is this
I'm attempting to make a ground item have specific color glows
but you can set the collision box
Entity glowing (contrary to what 7smile7 says) is ideally done with Entity#setGlowing, as it sets the field in the entity metadata packet instead of just using the potion effect which is gimmicky
Okay so
- Make a team for every color I want items to glow
- Upon receiving a drop of a certain glow color, assign the player to that team
correct?
Something like that
there are weird issues if you're using the TAB plugin but you can deal with those later
Unfortunately that means that all glowing drops will appear as the same color
love me a good TAB usage
Oh I see, makes much more sense.
EventPriority.LOWEST means it runs first or last?
first
thanks
LOWEST, ..., HIGHEST, MONITOR
if you do event logic on monitor i will send chocos huskies and mds kangaroos after you
all active developers here will also raid your house
then i need a little bit more help
i've 2 custom plugins
one which it is my custom armor plugin
high and highest
and another one is a Revive system
👍
in both of them i'm checking for EntityDamageEvent
in revive: when damage is more than hp --> kill player
in armor: when damage is more than hp --> break armor else getArmor - damage
Any chance you could explain this further?
should 1 take priority
what about the armor? the medic should be lowest and armor highest?
if armor should take priority, have that on highest, then revive on high
thats the problem, i don't know which one it should
when some one takes a damage way more higher than his hp, he does not gets knocked by my medic plugin and dies
any idea how can i store multiple strings and integers like a hashmap in pdc?
more pdc or serialize to byte array manually
well you probably want ur armor to always apply in these cases right?
i don't know, i just want to the player do not die immediately and get knocked down
he gets knocked, and dies after it immediately
id say players would notice if their armor is meant to block 50% of damage but get 1 shot by a 25 damage item
i remove the remaining damage from player if his armor is not enough
@echo basalt whats the proper sollution for this
2 plugins need to use entity damage event but they contradict eachother in what takes priority
@sage patio
wanna the event codes?
and do it
uh
what
the goal is if the player takes a high damage, whatever it is, get knocked instead of getting knocked and die
i don't know which one should take priority to prevent this
How can I add economyshopgui premium nbt? /// nbt_int: CustomModelData:1036 did not work even though I typed
are you using a beta version
it seems no, lemme test
I haven't seen the new update but I'm on version 4.11
might need to add it from nbt data
yea it works now, thanks
also i changed event priorities to LOW and HIGH
first
@sage patio mano yadet miad?
thanks, the question is already been answered twice
nope, speak english in here
im the guy from Minehack. you used to teach me some basic things
Hello, someone knows where the cracked property of the decoration pot is defines ?
I search in DecoratedPot data type but not found =/
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/block/data/type/DecoratedPot.html
I want to set the cracked (or not) of a decorated pot
well that happened a lot in "minehack", still no, but glad you remember me
how are your codding skills now?
I'm trexmine trial developer now
is there a way to get a tileentity from a block without reflection?
cant seem to find one
what are you trying to do?
tryna get an instance of TileEntityHopper
I failed
i did manage to do that but with reflection
somehow the entity's change scale is working but you cant see it
How do I get the inventory of a chest?
any ideas how to make it visible?
Block -> getBlockState() -> cast to Chest -> getInventory()
ye but what will u do with that?
if ur trying to get the inventory
Wrong chest class import
whoa
idk then
yea i did it with reflection but was just wondering if there was a way without it
I'd like to return the same type of set/collection I'm given. There a better way than doing this?
try{Set<Vector> rSet = locations.getClass().getDeclaredConstructor().newInstance();
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e){e.printStackTrace();}
?
like, other than clone, is there a way to just... copy... the type of the input set
actually clone wouldnt work
input of what
well I'm passing a Set<location> so that it doesnt only work on 'list of this type'
I'd like to return the same kind of set I'm passing in
public <T> List<T> doSomething(List<T> inList) {
List<T> outList = new ArrayList<>();
// Do something
return outList;
}
the input and output types are different though? this wouldnt work
I'm doing math on a list of locations, which turns into a list of vectors
public List<Vector> doSomething(List<Location> inList) {
List<Vector> outList = new ArrayList<>();
// Do your math
return outList;
}
I dont... understand what you are doing
Hi, I've seen many tutorials on the internet but I still don't understand how to make a project that supports multiple versions. Could you help me?
public static Set<Vector> toVectorSet(Set<Location> locations){
HashSet<Vector> returnSet = new Set<>;
//math
return (locations.getClass()) returnSet;
}
``` this, just in a way that it works
public <T, U> List<U> translate(List<T> inList, Function<T, U> function) {
List<U> outList = new ArrayList<>();
for (T t : inList) {
outList.add(function.apply(t));
}
return outList;
}
Something like this?
no, i read now
Would be used like this:
List<Location> locations = new ArrayList<>();
Function<Location, Vector> translation = loc -> loc.getDirection().multiply(2);
List<Vector> vectors = translate(locations, translation);
That's way too much effort
public static Set<Vector> toVectorSet(Set<Location> locations){
Set<Vector> returnSet = new HashSet<>;
//math
return returnSet;
}
Yeah this is honestly all covered by the streaming api
True
I think your problem is that you tried to create a HashSet with a Set constructor.
And that your method returns a Set and not a HashSet as well.
public interface Transformer<K, V> {
V transform(K key);
default List<V> transform(Collection<K> keyCollection) {
return transform(keyCollection, new ArrayList<>());
}
default List<V> transform(Collection<K> keyCollection, List<V> valueCollection) {
for(K key : keyCollection) {
valueCollection.add(transform(key));
}
return valueCollection;
}
}
:)
How to change where player has main slot?
public List<Vector> transform(List<Location> inputs) {
Transformer<Location, Vector> transformer = Location::toVector;
List<Vector> vectors = transformer.transform(inputs);
}
ah thats not exactly what i meant
like if i say List<Location> in my parameters
thats not a list, thats some class implementing it
my goal is to return a List / Collection of the same type that's thrown at the method
EEEEEEEEEEE, Using lambdas for interfaces not annotated as functional interfaces
nvm I have found out
:)
public abstract class Transformer<K, V, C extends Collection<K>, P extends Collection<V>> implements Function<K, V>, Supplier<P> {
public P transform(C input) {
return input.stream().map(this).collect(this, P::add, P::addAll);
}
}
@tall dragon I have seen what is written, but what is the difference between the module: "core" and the module "spigot-1.9.4"?
you cant
thats why i hate BukkitRunnable
1.9.4 is version specific while the core isnt most likely
core holds stuff like interfaces and spigot-1.9.4 implements those interfaces with version specific code
1.19.4
same thing applies
im so confused i have a common module that shades a library, then when my other module shaded the common module it shades that library again. so i end up with the same library twice in different locations
why is that happenin
Well in most cases lambdas are a hacky approach anyways.
If your lambda is longer than 3 lines you should write an implementation
or at least a method reference.
you relocate it
^
in both places
if you shade it in common, dont shade it in other
So "core" is the heart of the code but "spigot-1.19.4" is for implementing NMS in the code. Right?
yea
i dont
i dont even have it as dependency
but it still shades it
anyone know of royalty free svg pages
only common has it as dependency
transitive depdency then
what does that mean
another depdency also shades it
Because it has fields. It wraps the bukkit task it is creating
only common has xseries as dependency
or should i not be relocating in common then
only in core
Doesn't BukkitRunnable have like .runTask() and stuff?
ok
Do I have to register event (custom event) in main class?
why is there method to do that then
You can register it wherever you like
oh you mean that
Because is Otherwise?? i have do all...
there should be why it is there
otherwise it should be deprecated and removed
To be more precise: You dont need to register custom events at all.
You can just fire them whenever you like.
ExampleEvent exampleEvent = new ExampleEvent("Some message");
Bukkit.getPluginManager().callEvent(exampleEvent);
Ig to register a listener?
yeah
why the hell is this not throwing any errors
to make it only listen to a specific event
yeah
javadocs hold the answer
looks little useless to me but okay
You should pretty much always use the .registerEvents(Listener, JavaPlugin) method
There are certain cases where the other methods make sense
I remember I recently coded in bukkit for mc b1.7.3 and it had a different implementation of event listeners
anyone got tips on how i could change this to not just be blank or have stuff non related
whats that?
fuck's a 'not thread safe' list
A list thats not thread safe. Most of javas collections are not thread safe.
wait is this that 'lock before editing' thing?
docusarus
You can create a lock. Its basically a ticket which lets a thread edit an object.
And only one thread at a time can have a ticket. If the others come and request
a ticket but another thread is currently in possession of this ticket, the other threads
block and wait for the ticked to be released. Then the next thread can come and obtain
this ticket.
This is known as a lock or mutex
im so confused
I remmeber that there was a thing like Collections.threadSafe(collection)
I saw it on johns video
About vectors
u prob mean the synchronized wrapper
They are?
How do you set the ID of an item stack? before you could use #setDurability() but thats deprecated
pretty sure they're not
Ah. Those are kind of thread safe. But not really.
Well, dont they just have synchronized methods?
ah i was looking at the bukkit vectors
idk
i just know they are thread safe
web dev confuses me so much
like theres a white block that i cant figure out how to change the color of
oh now that im looking at the source
what's '@serializableas("Vector")' mean?
its not turning into one
it saves it as !== in config
serialize turns it into a map string that set can use
soo
what do you mean by ID of an itemstack?
i did it, go me
like yk how they had numbers to show which color or which variant an item is?
do they not do that on 1.20 anymore? I finally switched from 1.8 to 1.20
this looks better
but like
for coloring and other stuff ItemMeta covers that
or different material types
since magic values bad
No, those where dropped half a decade ago because magic numbers are bad.
We now have proper classes with named methods to modify ItemStack variants.
its mostly slow
Its, slow
I breaks easily
It relies on meta information
and its really not portable
I see how would I read the type and set the type?
it makes your code dependant on the names of the fields and methods
Give an concrete example pls
i disagree that magic values are bad tbh
Thank you
If you are not careful then a single reflection can take upwards of 200ms and ruin your TPS all by itself
I have a wool item stack. How do I get which color it is and how do I change which color it is?
it does for annotation processing
?
Should i have one class named 'Shapes' procuding geometry for different shapes, or multiple classed each named after the shape the only method it would have would produce? I'm not sure which route to take here
Ok
retrieval of things are faster when using magic values rather than registry classes with strings as a keys
how are magic values not just bad?
iteration 30 chars vs 1 32 bit integer check
dude
constants
what about constants
In this devlog, I made a minecraft clone voxel game that runs fast in Java, that manages to get the same render distance that's available on the bedrock edition of minecraft (equivalent to a render distance of 96!).
Useful resources:
LibGDX: https://libgdx.com/
Minecraft cave culling algorithm: https:// tomcc.github.io/2014/08/31/visibility-1.html
you should see this
i saw it
yes dovidas data oriented programming is ofc a paradigm u have to consider
but like
readability is just really important
"retrieval of things" what does that mean?
You mean runtime speed? What is faster.
Registry classes are not the only method of eliminating magic values.
especially when u deal with the amount of state minecraft has
Magic values are absolutely evil
I mean sure object orientation sucks anyway
since you're apparantly either a wizard or a storyteller, which of those is evil?
but since minecraft now is object oriented we might as well do it good and not bad
i get it why minecraft switched from ids to namespaces, its due to make adding new blocks and states easiers for modders, so that they wouldnt rely on some strange id system like 2500:14:32
not only
but still it wasnt really a problem that was very bad
Abstract factory maybe? lol
hm that gives me an idea
Having to remember random numbers is a big problem when programming
hashmap of strings, vs index based retrieval
87.. 52.. 56?
for you to decide which is faster
i'm likely to generate more than one shape at once, so having an interface thats implemented by the classes and has a method named 'generate' or smth
namespaces are much needed
that's why enums exist
Spigot uses reflection to load plugins right?
enums are evil
which have ordinal()
then Spigot and Bukkit API is too
Each wool color has its own Material
well I think magic values are bad in general
Whats magic values
Magic values in an int type for me is bad, but when you have an Enum to denote those or preprocessor defines i dont see a problem with them
A number in code which has no associated name
Ok
where u have no idea what those scalars will do
enums are great except that they are not, they prevent open closed principle, more often they do become a dependency magnet which is just clumsy
unsure why magic numbers would ever be a positive. They just create confusion. I always document magic numbers into well named constants
I have had to recode half of my minecrafts recipe system in my mod just because stupid enums

