#help-development
1 messages · Page 1190 of 1
I mean, it can't be helped, it isn't like they don't want to share the code, it is that they can't
best we can do is recommend ways for them to debug it rather than asking for small bits really, but I am curious as to where this is pointing to so I ask lol
I'll get some sleep now cause 1am troubleshooting isn't going to help anyone
Hope you guys can solve the issue
Do use the debugger it's the easiest way to track down the issue
instead of going through line by line manually and make simple reading mistakes like I just did 💀
dude its some bs that
you still haven't changed the method signature
change it to public @NotNull EnumMap<DataTypeImpl, AbstractDataType> toEnumMap()
same error ig
so the class extends DataMapManager
of DataMapManager<@NotNull DataTypeImpl, @NotNull AbstractDataType>
at com.himerarp.computer3.pc.impl.component.storage.StorageData.toEnumMap(StorageData.java:33) what is this line also, just to know where exactly the cast is happening
well that doesn't make any sense
why would it be trying to cast it to a float there if the enum map is indeed AbstractDataType
mad confusing bro
is spigot breaking api or something, i cant do /skulls with essential x
why can you not?
did you update essentials x
how do i see what version i am using
am on aternos
nvm i found
i am on most recent yes
Move to #help-server this channel is for development
Also you're probably just on the stable build. There's probably a newer dev build
it does if they are not overriding the method they think they are
might be wise to see what the IDE thinks the method is coming from
however, I think I might know the issue though
what java version you using to compile?
17
what version is that lib compiled with?
17
can anyone help with this?
we are on java 17 - paper 1.19.4
is that lib yours?
yeah
if both projects are yours then I think it might just be an IJ issue
and issues from compiling don't affect runtime?
i guess they do but what can IJ be doing
IJ does quite a bit of its own stuff
mm i see
I would try clearing caches, and restarting IJ and then try re-compiling with a clean build
to just make sure its not the IDE doing weird things
alright ill give it a go
it doesn't matter, IJ does its own stuff when it comes to those plugins etc. Unless you specify a very specific compiler to be used the one from the IDE will be used
aight its re-indexing n shi
they are not magic and have to be intercepted either before or after the compiler depending on what it does 🙂
Which is why they're specified in the build file
either way, it touches the compiling portion where you said it doesn't
And not in Intellij settings
not sure what settings has to do with this
anyways I am not going to argue anymore, unless you can specifically prove to me that nothing in IJ ever touches the compiler I simply am going to ignore what you are saying
You can see the command it runs to start the process
and no I am not talking about stuff in settings. If you don't specify a compiler for gradle or maven plugins to use, they will default to whatever the IDE provides
Yes I never said it won't
I said that Intellij doesn't inject stuff in to the pipeline
ok, IJ's compiler isn't vanilla Java compiler
aight i invalidated chaches n all that same error tho
Intellij allows you to pick the compiler during install
It doesn't ship with one
It has its own o.O
Are you thinking of Eclipse
You can also change anything in the settings or in the respective dependency manager file.
and no
Jetbrains do have their own
are you using any annotations?
no
something has to be changing your source code somewhere because it doesn't just magically require a float when you created the method in the lib to not accept a float
so....it could be the annotation processor screwing it up
in that case, either make sure your annotation processor is updated version or trying removing the annotation stuff
i mean i have lombok
thats abt it
not in that class tho
@Getter
@Setter
@AllArgsConstructor
public abstract class AbstractDataType {
private final DataTypeImpl dataType;
private final int multiplier;
private float amount;
}
could it be here
this is one of the reasons I don't like using annotations lol
What version are you compiling against?
this isn't an annotations issue
it is just the data being passed being the wrong type, however we don't know where it comes from since we can't see the code
though I guess if they had delombok setup the stack trace would be more useful
If they are trying to compile against 1.21.4, then they shouldn’t be using enummaps.
Stuff was getting changed over to individual classes and registry shiz
it could be if its not putting the right stuff in, or changing it incorrectly
this isn't an enum map for a minecraft type, it's their own custom data type
so it is alright
Ah
they are compiling against 1.19.4
well, anything above 1.14 anyway
at least that is what the stack trace shows the version of them using anyways
I don't think we can help you with this one tbh john
can't say they are indeed compiling for that since I don't know their build setup 😛
it is matter of sitting down and looking at what the debugger tells you
ill provide any piece
can also screenshare if u want
where IJ is telling you the type is wrong, can you tell IJ to follow where it is coming from?
like tell it to open the class the method originates from
I don't use IJ so not sure if that is possible. On Netbeans I could do that
if you still didn't figure out when I'm done cooking, let's do that
it's possible, but the thing is that the type isn't wrong since it's hidden behind a bunch of generics
It is possible. Just gotta ctrl click the method and it shows usages.
its not
alright thank you bro
well, it has to be wrong somewhere otherwise runtime wise it would be correct
IJ isnt saying any problems
well that'd be the case if we were only dealing with concrete types, but since there's a bunch of generic types being used, that wouldn't be the case
that was just them forgetting to change the method signature, they fixed it afterwards
ah
even if we are using a bunch of generics, it means somewhere along the way its being changed incorrectly or the method is requiring the incorrect type
What’s the current error?
What is the original error? I joined late to this convo
https://paste.md-5.net/eqegarivaf.rb this was the og error
Class cast exception.
Where is the code responsible?
after we changed toEnumMap to return a EnumMap<DataTypeImpl, AbstractDataType> from EnumMap<DataTypeImpl, Float>, it became this one: https://paste.md-5.net/iqudoxahac.rb
this is the code responsible (taken from #help-development message):
@Override
public @NotNull ItemStack getItemStack() {
ItemStack itemStack = super.getItemStack();
itemStack.editMeta(meta -> StorageKey.DATA.set(meta, this.data.toEnumMap()));
return itemStack;
}
It’s still the same error tho?
somewhere they are using an incorrect generic type that only throws a warning in compiling but in runtime errors out
@RequiredArgsConstructor
@Getter
public enum StorageKey implements IPDCKey {
DATA("data", DataType.asEnumMap(DataTypeImpl.class, DataType.FLOAT));
private final @NotNull String key;
private final @NotNull PersistentDataType<?, ?> type;
private final @NotNull RPComputer3 instance = RPComputer3.instance;
}
and this is StorageKey.DATA
well, there is one instance of where its requiring a float
finally, I believe this is the set method:
default <T> void set(@Nullable PersistentDataHolder holder, T value) {
if (holder != null) {
PersistentDataType<Object, T> type = this.getType();
holder.getPersistentDataContainer().set(this.getNamespace(), type, value);
}
}
Hmmm, it’s times like these it would probably help if I knew/used Lombok
so, its possible that float is being inputted but they are trying to grab it out as something else that isn't compatible
this is one of the reasons I don't really like using generics if I don't have to 😛
all it does it make getters for fields
be surprised in how often it can be a source of problems, but your case isn't one of those
Tbf it can do a lot more than getters and setters
But things just get more hacky the deeper you go
lol
thats all i use tho
yeah wouldve figured it out by now if it were
DATA's PDT is MapDataType<EnumMap<DataTypeImpl, Float>, DataTypeImpl, Float> from the looks of it lol, that looks wrong
Is this a custom data type for the PDC?
the PDT comes from MoreDataTypes lib
isnt it meant to be EnumMap<DataTypeImpl, Float>
yeah using jeffs thing
this looks like it might be the source of your problem
how is it that tho
Ah so we should have Alex here then
i dont think thats the problem tho
it could be I am reading this function signature wrong, but this:
DataType.asEnumMap(DataTypeImpl.class, DataType.FLOAT)
would indeed return MapDataType<EnumMap<DataTypeImpl, Float>, DataTypeImpl, Float> if we look at this method signature
static <E extends Enum<E>, V> MapDataType<EnumMap<E, V>, E, V> asEnumMap(@NotNull Class<E> enumClazz, @NotNull PersistentDataType<?, V> valueType) {
return asGenericMap(() -> {
return new EnumMap(enumClazz);
}, asEnum(enumClazz), valueType);
}
who knows, but what I do know is he knows his libs though lol
That’s a lot of EVs
but maybe that's just how the thing is serialized so idk honestly
It’s like Pokémon up in here
that is how I read it too
what happens if you change it to a normal map instead of an enum map
let me show u how it was before
it used to be like that and it worked
old enum ^
New enum?
so you just changed the name
PersistentDataType was also changed too
i dont think that really matters
yeah and removed NONE 💀
I checked MorePersistentDataTypes to be sure, it is just a constant that points to PersistentDataType.FLOAT
ah
you still haven't shown what this#getMap is
hey fellas, in spigot 1.20 and onwards how do you create custom mobs?
i'm trying to make a simple zombie but using old docs is outdated idk what the entity classes are now
for example
?mappings
Compare different mappings with this website: https://mappings.dev/
?nms
Remapped names are now common
is creating custom mobs still the same as before?
Yeah
also im wondering if you can set aggression to entities not defined in default vanilla behavior
ie iron golem attacking players normally
Depends on how far back you are lol
You can
i believe you extend existing mob class and then set attributes and you can set custom goals, etc
hm do any of you have modern examples of custom mob code
that was why I couldn't find it, I was looking under his Jeff Media
Hi, can someone explain why squids are moving even tho i set no ai and has no gravity?
It's the same as it's been for years but with new method/class names
Check mappings site to convert
Select the version your are developing for and use the search box to type in the old names.
i see
they are shading this into their project right?
so entityZombie is now under package net.minecraft.world.entity.monster.EntityZombie ?
I'd assume so, I don't know how their thing is setup
pretty much
right....another thing we need to be shown
let's make a thread
yeah that would be useful
You want the Mojang mappings ones
?nms
^ to get Minecraft package and such
Yes, with the —remapped flag
what's the reason? is it for future development and whatnot
or best practice
actually both, why isnt the minecraft included by default
Copyright law
Can't distribute Mojangs code
i see
As for the mappings you'll have a real bad time without them
i thought buildtools was for setting up spigot servers too right
It is
Everything except class/package names will be obfuscated
Multipurpose
i see
Technically it is in a way, however the minecraft jar isn't accessible via normal means because mojang forbids distributing of their stuff.
buildtools does indeed download the minecraft.jar though and then modifies it to its needs and then bukkit and spigot are built against it
i c
having trouble with buildtools, do i run it in my plugin's root directory?
the wiki suggests its own folder
I personally use gitbash to run buildtools
and yeah have it in its own directory because its going to create files and directories in the place it is ran from
if you already ran build tools with the remapped argument, just follow the steps ofthe blogpost
i was looking at this but couldnt find it https://www.spigotmc.org/wiki/buildtools/
wdym
the remapped flag or what?
if you are on windows, you can just use the exe and it'll be a checkbox in the gui
if you are not on windows, then you'll have to run it from the terminal
?nms
I meant this blogpost sorry
wait so if i use gradle i cant use the buildtools gui or anything?
so i see, i use this ? https://github.com/patrick-choe/mojang-spigot-remapper
plugins {
id 'java'
id("io.github.patrick.remapper") version "1.4.2"
}
group = 'io.github.derec4'
version = '0.0.0.1'
repositories {
mavenCentral()
mavenLocal()
maven {
name = "spigotmc-repo"
url = "https://hub.spigotmc.org/nexus/content/repositories/snapshots/"
}
maven {
name = "sonatype"
url = "https://oss.sonatype.org/content/groups/public/"
}
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.21.4-R0.1-SNAPSHOT")
compileOnly("org.spigotmc:spigot:1.21.4-R0.1-SNAPSHOT:remapped-mojang")
}
..........
is initPathfinder not a thing anymore?
if you depend on spigot, you don't have to depend on the spigot-api
where is that from and what are you trying to do with it?
i see
@Override
protected void registerGoals() {
super.registerGoals();
// Add custom goals here
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, .../
}
}
i tried registerGoals
oh what
im so confused haha
how do i make my entity not target players if it is a zombie?
you just remove the pathfinder goal
hm how does the goal class work
public class CustomWitherSkeleton extends WitherSkeleton {
public CustomWitherSkeleton(EntityType<? extends WitherSkeleton> entitytypes, Level world) {
super(entitytypes, world);
this.collides = false;
this.setInvulnerable(false);
this.setCanPickUpLoot(false);
this.setAggressive(false);
this.setCustomNameVisible(true);
this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, Sheep.class, true));
}
@Override
protected void registerGoals() {
// super.registerGoals(); Sets default mob logic
}
}
so now i made a custom skeleton mob
how do i register it?
Add it to the world
level().addentity
Or something like this
level().addFreshEntity(this, SpawnReason.CUSTOM);
This being the custom entity
double angle = context.angle;
// Calculate new armor stand position
double x = RADIUS * Math.cos(angle);
double z = RADIUS * Math.sin(angle);
Location newLocation = location.clone();
newLocation.setYaw(0);
newLocation.setPitch(0);
context.setOffset(new Vector3f((float)x, 0, (float)z));
// Calculate tangent vector
Vector3f tangent = new Vector3f(
(float) (-RADIUS * Math.sin(angle)), // Tangent X
0f, // Tangent Y
(float) (RADIUS * Math.cos(angle)) // Tangent Z
);
tangent.normalize();
// Up vector
Vector3f up = new Vector3f(0, 1, 0);
Quaternionf quaternion = new Quaternionf();
quaternion.lookAlong(tangent, up);
context.setRightRotation(quaternion);
// Increment angle
angle += Math.toRadians(5); // Adjust the step size for rotation speed
if (angle >= 2 * Math.PI) {
angle = 0; // Reset angle to avoid precision loss over time
}
context.setAngle(angle);
context.updateConfig();
entity.setConfiguration();
Can any smart math person tell me why my projectile is facing the wrong way? I am using interpolation now so I feel that might be part of the issue?
do i have to register it in the main class?
or do i spawn it in using normal code
like a command or trigger
you can register the custom entity where you feel like
do you want the projectiles to face you?
no, tangential to the circle so it looks like its revolving around me if that makes sense
i dunno, not that good at math yet
a atan2 does this while
double atanAngle = Math.atan2(context.getOffset().z(), context.getOffset().x());
Vector3f tangent = new Vector3f(
(float) (Math.sin(atanAngle)), // Tangent X
0f, // Tangent Y
(float) (Math.cos(atanAngle)) // Tangent Z
);
This seems to work peroperly
just oeriented backwards lol
oh i meant like do you need to register them like commands?
you dont need to register them to the server to spawn them if thats what you mean
but if you don't register them, they wont save properly in the chunk
as far as i know if you add them to the world they'll be saved to the chunk, there's a method you have to override to prevent them from being saved
look at 3ricL's comment
but this is for 1.18 non remapped so you'll have to figure it out for remapped
there are a lot of methods to go through but i could take a look
i see this method in Entity
not sure if this is it
you can try to overwrite it and see if it's still spawned after a server restart
Providing you’re using the code you provided you’d be overriding the method for your CustomWitherSkeleton entity (Which extends WitherSkeleton)
And you do that in the class yes
bump
Hi
What error are you getting, you never specified? it helps me get to an answer quicker without having to run any code myself. @tiny tangle
Also cant you use scheduleSyncRepeatingTask instead of just a runnable?
looks like gpt
Could be
but im confused, why are they trying to calculate it?
isnt it provided as a method under Server?
https://jd.papermc.io/paper/1.21.3/org/bukkit/Server.html - getAverageTickTime
declaration: package: org.bukkit, interface: Server
🤔
They did say with paper :p
Heresy
nuh uh
oh what its not
naur
welp,
spigot doesnt really expose tps stuff i think
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/ServerTickManager.html there is this class tho
declaration: package: org.bukkit, interface: ServerTickManager
but that might be for the like weird new tick command or whatever
i think getTickTimes might also be a paper method 😭
altho ig if hes working w paper like u said, might as well use paper api
I've never actually used Spigot.
I always just use Paper
but I find this community much chiller
yep, but if u would use the paper methods theres also an averageTickTimes directly
Yep
you could get the current tick rate every tick and every second or so do avg tickrate / 1000
But that would be a very rounded average i suppose
yes, but sadly, i use Spigot
im not getting any error, what im trying its to measure the server mspt , but I dont know if the code above its the right approach, and I do not know how to proper measure it.
You said you were.
im using a simple method, but cannot use paper and bukkit api same time getting error
yeah, cannot use paper and bukkit same time, because getTps or getAverageTickTime its paper function, so i was wondering only using bukkit, how to proper measure the mspt of the server.
i was using tabstps and the mspt that the plugin shows, and what I did on the code that I posted, when comparting the amount of the output , I suppose mine its giving wrong value amount.
I’m all for DIY but just checking you know about the Spark plugin right?
@Override
public void run() {
long currentTime = System.nanoTime();
long timeTakenForTick = currentTime - lastTickTime; // Time in nanoseconds
lastTickTime = currentTime;
mspt = timeTakenForTick / 1_000_000.0; // Convert to milliseconds```
What addModifier does something besides opiations with meanings do?
is ItemMeta#setCustomModelData() going to be deprecated now that custommodeldatacomponent is a thing
what are you asking
addModifier in attributeInstance
yes and whats the question
@tiny tangle this was for you
read what i writed
addModifier do smth else besides operation with value?
i want to know why addModifier exists. Why not exists methods like "setValue", "removeValue"
so, an AttributeInstance is basically just your stat value of whatever stat you want to have, take ATTACK_DAMAGE for example
attributemodifiers modify the base value of that stat. modifying the base damage directly is not a good idea because you can't properly undo those modifications
if you were to modify the max health of a spider for example by using AttributeInstance#setBaseValue, and let's say that for whatever reason you wanted to undo those changes, you can't just set it back to whatever AttributeInstance#getDefaultValue() is. Because for MAX_HEALTH, that's always 20, and spiders don't have 20 max health by default.
it's also better because other plugins might want to do the same thing, and by modifying the base stat directly you're interfering with them.
attributemodifiers are the recommended way to modify stats because you can easily add and remove them whenever needed.
if you want someone to have a couple extra points of attack damage, you use an attributemodifier with the ADD_NUMBER mode.
if you want someone to deal a percentage more damage with their attacks, you use ADD_SCALAR.
MULTIPLY_SCALAR_1 does basically what ADD_SCALAR does, but much stronger. it's a bit difficult to explain but having several MULTIPLY_SCALAR_1 modifiers exponentially increases your stat values
uhm, i know spark, but I wish to have own plugin to meausre only that , because i need to add other functions for a certain user case. I read the tabtps github files, but there was so many files that i dont know here to look it, very spread and i got more confuse.
attributes and modifiers are not intuitive, i don't blame you for being confused. but you should always add attribute modifiers instead of modifying the base stat value directly
hwy guys how do you spawn a custom mob you made using a command?
like assuming a template command is made
how do i spawn the mob
you use World#spawn and pass whatever class your custom mob has to it
nice thenks
what's this addFreshEntity i see
World world = player.getWorld();
CustomWitherSkeleton customWitherSkeleton = new CustomWitherSkeleton(EntityType.WITHER_SKELETON, world);
customWitherSkeleton.setPos(location.getX(), location.getY(), location.getZ());
world.addEntity(customWitherSkeleton);
so im trying to spawn it like this but it's not recognizing the Wither Skeleton as a mob
but it's pretty weird, they could just be separate from each other.
what could be separate
baseValue and value
baseValue and value are separate from eachother
getValue() represents the stat value after all calculations, getBaseValue() only returns the value before calculations
the calculations are the attributemodifiers
like, lets take an example of having an attack damage of 1
if you have 3 attributemodifiers in this instance,
- ADD_NUMBER 5
- ADD_SCALAR 0.5
- ADD_SCALAR 0.5
then getValue() returns (1 + 5) * (1 + 0.5 + 0.5), which is 12
getBaseValue() will still return 1
all modifiers connected with each other?
why exists argument like uuid and string
if i getting attribute from player
oh
i see
yeah all modifiers are connected like that
uuids and names are just useful for identifying these modifiers
what if i want SET value
i think they are indexed by uuid, so if you add a modifier with the uuid of an existing modifier it overrides the previous
you dont want a set value
but i need synchronize
with what
with custom attributes
in what way
you know players have a base damage of 1 so if you want to set it to 6 so bad you add 5
with an add_number modifier
sec
i creating basic plugin with roles
race
and types
and i have formula
i not can just add or remove
looks like I'm gonna have to flip the formula
oh nuh
i find easly path
any help on my entity spawning?
You’ll need to use the NMS version of the world to add the entity
Is it worth adding to the api the ability to change parameters by a third-party plugin if these parameters are updated and reset on reboot and depend on the config?
I figured but just wanted to make sure, 👍
Is there way to get line of ConfigurationSection?
Wdym a line
hm? but why
yeah, need anyone could help me out ,or give me a hint clue how to measure it, not sure also if its way complex to measure it as a tabstps, but I only want the mspt function.
I need to log warn about some misconfiguration user make
No there's no way to get the line unless you search for it yourself. Just the path should be sufficient though, no?
YAML is structured so you can print out the path to the option that's misconfigured
hey, i got this code to place blocks beneth me but it just doesnt place the blocks and the locations are the right ones
ArrayList<Location> cloud = new ArrayList<>();
for (double i = player.getX()-2; i < player.getX()+2; i++) {
for (double j = player.getZ()-2; j < player.getZ()+2; j++) {
cloud.add(new Location(player.getWorld(), i, j, player.getLocation().getY()-1));
System.out.println(i + " " + j + " " + (player.getLocation().getY() - 1) + " ");
}
}
for (Location location : cloud) {
location.getBlock().setType(Material.WHITE_WOOL);
}
you got the Y and Z axis flipped
^ in new Location
Is it possible to send multiple text components(one string, to clickables) in a single message?
does doing bump is it considering be spam?
You can bump if you want to
No, so long as its not too frequent
^^
want to accomplish but dont know how to do it
merely only with bukkit
@Override
public void run() {
long currentTime = System.nanoTime();
long timeTakenForTick = currentTime - lastTickTime; // Time in nanoseconds
lastTickTime = currentTime;
mspt = timeTakenForTick / 1_000_000.0; // Convert to milliseconds```
what is yoru issue? You might want to use millis over nano as nano call is more expensive
and as you only want mspt it should be fine
uhm, the issue its that the mpts that the tabtps its showing with that small function , both given values isnt the same
so i was wondering how to measure properly to give me the same value as the taptps shows, because i only want that function to be used with other experimental things.
tps is not mspt
and you are assuming theirs is correct while yours is not?
mspt is as accurate as you are going to get it. Your code is fine. Any difference would be in their code
probably, their github has many files many implementations i got lost on it, so probably i was wrong doing something or missing putting something
oh
its weird
because uhm as example, i was getting around 15 to 20 mpst with that plugin with constant update, as mine its giving 45 to 55
so i was kinda confused
are you sure you and they are talking about the saem thing?
mspt is milliseconds per tick
tps is ticks per second
yeah, my tps its stable at 20 , im not trying to get tps value
the mspt will vary greatly depending on what is actually happening
on average it should be close to 50
are you sure the plugin is not showing you how many millis the tick took, not the time of each tick?
that may be a confusing statement
if i could send a picture
The work processed ina tick may not use up the whole 50ms
to show
it sounds to me like the plugin is showing how many ms was taken to process each tick
uhm oh probably make sense, i mean i cannot differenciate the calculations
Your code tells how long each tick is, which will always be very close to 50, unless overloaded
im getting around 45 to 55 , but with the plugin its showing around 10 to 25 depends on the entities thats on the over the world
probably the plugin as you said its using other calculation formula
45-55 sounds fine for teh time of a tick
if their value increases with more entities then its showing how long the tick took to process
the closer it gets to 50 would indicate getting close to an overload
ok, i probably stick what you said hahah its giving me a bit crazy i will asume that the amount of 45 to 55 its fine
haha
so next step its to lower that amount so its gets better for performance?
with their plugin, yes lower is better. Less load
with yours it should always be around 50 unless overloaded. less work will not lower yours
To accurately calculate teh load on the server you need a tick start time and a tick end time.
uhm thats sounds kinda complex, what im trying to accomplish its to have a function reference over the average mpts value , then trying to "attempt" lower it to probe some experimental stuff to get some improvement % , but doing mine it seems
two start times only tells you if its doing too much, it can;t tell you how little it is doing
you need to measure the start/end of the tick, which you can;t do in a scheduler
ouch
make sense
bad thing its im trying to work "attempt" to do for hybrid server in mind, cannot use paper api and bukkit same time.
doing two start times probably dont help me go more further :C
nope
paper has extra events for tick start/end so its simpler for this kind of thing. Spigot does not. You'd have to implement your own
ohh shit
can i ask
if and entity as example villager or animals etc , having modify their tick rate to near 0 , is it good for the server?
i mean as for example the farmcontrol plugin, its like having many entities in one place, they move to much /tick rate very high?
does it reduce the tick rate near 0 to reduce all the movement to make these entities dont move like a near freeze state, being same as to have lower the tick rate?
could someone help me with something possibly?
@EventHandler
public void onSilverFishAttackEvent(EntityDamageByEntityEvent event) {
if (event.isCancelled()) {
return;
}
if ((event.getEntity() instanceof Player)) {
if ((event.getEntity().getLastDamageCause().getEntityType() == EntityType.SILVERFISH)) {
event.getDamager().getType();
event.setCancelled(true);
EntityDamageEvent xd = event.getEntity().getLastDamageCause();
((Player) event.getEntity()).damage(20);
event.getEntity().setLastDamageCause(xd);
}
}
}
}
I'm making a plugin. I want it to change the damage of a (Specific) mob. Example: I spawn a Silverfish instead of it doing its default attack damage I want it to do damage (4) when attacking player. This is what I have so far
Don;t cancel the event, just setDamage
so like this
@EventHandler
public void onSilverFishAttackEvent(EntityDamageByEntityEvent event) {
if (event.isCancelled()) {
return;
}
if ((event.getEntity() instanceof Player)) {
if ((event.getEntity().getLastDamageCause().getEntityType() == EntityType.SILVERFISH)) {
event.getDamager().getType()
EntityDamageEvent xd = event.getEntity().getLastDamageCause();
((Player) event.getEntity()).damage(20);
event.getEntity().setLastDamageCause(xd);
}
}
}
}
no
Is there a good way to use brigadier with spigot, or should I just resort to paper?
Im sorry very new this one the next step for me to go down just trying to learn new this this one might be a ltitle hard for me
there isnt
literally event.setDamage(xx)
I recommend using https://github.com/lucko/commodore
@EventHandler
public void onSilverFishAttackEvent(EntityDamageByEntityEvent event) {
if (event.isCancelled()) {
return;
}
if ((event.getEntity() instanceof Player)) {
if ((event.getEntity().getLastDamageCause().getEntityType() == EntityType.SILVERFISH)) {
event.setDamage(20);
like that?
yes
code was fine but now when i spawn a silver fish it dose defualt attack damage?
i set it to 20 but dose nothign diffrent
just delete that then?
getDamageSource and getEntityType is what you want
if(event.getEntity().getType() ==
@EventHandler
public void onSilverFishAttackEvent(EntityDamageByEntityEvent event) {
if (event.isCancelled()) {
return;
}
if ((event.getEntity() instanceof Player)) {
if ((event.getEntity().getLastDamageCause().getEntityType() == EntityType.SILVERFISH)) {
event.setDamage(20);
or event.getEntityType() ==
if ((event.getEntity() instanceof Player)) {
if ((event.getEntity().getLastDamageCause().getEntityType() == EntityType.SILVERFISH)) {
event.setDamage(20);
my bad
if ((event.getEntity() instanceof Player)) {
if ((event.getEntityType() == EntityType.SILVERFISH)) {
event.setDamage(20);
I said don;t use getLastDamageCause. Your damage has not happened yet
I removed that
the Entity in teh event is refering to who is going to be damaged. So in this case a Player
@EventHandler
public void onSilverFishAttackEvent(EntityDamageByEntityEvent event) {
if (event.isCancelled()) {
return;
}
if ((event.getEntity() instanceof Player)) {
if ((event.getEntityType() == EntityType.SILVERFISH)) {
event.setDamage(20);
getDamageSource().getDirectEntity() would be the silverfish
Im lost
if (event.getEntityType() == Player && event.getDamageSource().getDirectEntity() == SilverFish)
pseudo. fix where needed
I said it was pseudo code
Its basic java to fix those errors
hover over each and see what it suggests
im still learning basic java
@EventHandler
public void onSilverFishAttackEvent(EntityDamageByEntityEvent event) {
if (event.isCancelled()) {
return;
}
if (event.getEntityType() == EntityType.PLAYER && event.getDamager().getType() == EntityType.SILVERFISH)
event.setDamage(20);
}
}
I was able to get it to work thank you so much @E I really appricate it
looks good
Sorry im a little slow
learner
thanks for being patient and taking time!
been typing to fix this for 2 days haha
anyone have a way of when i break a diamond block it drops a specific item with a specific chance of getting that item so far i have it to when a diamond is broken it spawns a NetherStar and a diamond but i want it to be rare chance of dropping the netherstar so its dose not always give one how would i do that?
@EventHandler
private void onDiamondBreak(BlockBreakEvent e) {
Block b = e.getBlock();
Player p = e.getPlayer();
if (p.getGameMode() == GameMode.SURVIVAL) {
if (b.getType() == Material.DIAMOND_ORE) {
e.setCancelled(true);
b.setType(Material.AIR);
b.getWorld().dropItem(b.getLocation(), new ItemStack(Material.NETHER_STAR, 1));
b.getWorld().dropItem(b.getLocation(), new ItemStack(Material.DIAMOND, 1));
how would i set a chance of getting the NETHER_STAR
can someone help?
random.nextFloat() < chance
i cant figure out the code to change the hologram display of my crazy crates plugin
Is the crates plugin yours?
Or are you trying to override it
please for the sake of readability write things out... it takes like half a second
i didnt sdee it before
override
and found it luckilly
thx anywys
Does anyone know how Attributes work? I just tried doing to most simple form:
player.getAttribute(Attribute.ARMOR).setBaseValue(5.0);
but i still get an error that basicly saids attributes dont exist, like huh??
Class org.bukkit.attribute.Attribute does not have member field 'org.bukkit.attribute.Attribute ARMOR'
What version are you compiling against
Spigot 1.21
.0?
Yes, just base 1.21 release
It's GENERIC_ARMOR in 1.21
you should use the latest version available if you're already compiling against 1.21 tbh
hmm is it a different way to get to that then, because just using it doesnt work. ChatGPT also gave your answer.
You've messed up your dependencies
Amazing
How are you compiling the project
As in... building it...? Sorry trying to understand what you mean, not an expert xd.
yes
For the project creation I used the Minecraft Development plugin for Intellij which was at that time only on 1.21 max, then I just hit build and put in my localhost plugin folder. I dont know how to get your answer sorry
Does your project contain a pom.xml or a build.gradle(.kts)
Yes it contains a pom.xml
pasted it... i think?
Now send the link
The project is set to use 1.21.3
I see at the bottem with dependencies that it saids 1.21.3 is that the issue?
yes
ehm
Thanks a lot already btw
Switch back to using ARMOR
also I suggest updating to .4
Simply change the number and click the little maven reload icon in the top right
Alright its loading
When it's done open the maven tab on the right and find package under lifecycle
double click that to build
Now your plugin jar should be in your target folder
Also make sure that you run the plugin on a 1.21.4 server
to ensure it will work correctly
Yes il update. Thanks a lot
you mean 1.21.4
1.20.4 🔫
yes
olivo when spring 🔫
I keep writing/reading 1.20 💀
tbf so few time has passed since 1.20.4 that it doesn't seem right to write out 1.21.4 already lol
?howold 1.21.4
?1.8
Too old! (Click the link to get the exact time)
?howold 1.8.8
Minecraft 1.8.8 is 9 years, 4 months old.
how do I make lore not in italics with minimessage
<!i>
Yes. I noticed paper doesnt have fully released 1.21.4 yet so just to be sure I downgraded the plugin again to 1.21.3 and setup a paper 1.21.3 server. Now the issue is that when I try to build instead of compiling into a jar file now it just idk how to put this ehh downloads the project folder into the target file.
Why are you building without packaging it?
Also I don't quite understand your issue
idk, normally I hit build and the jar file updates/appears where it is suppost too, but after i downgraded from 1.21.4 to 1.21.3 again using the same method it just doesnt output a jar file, but the project itself(folders, classes, etc)
Did you run package
after changing it back to 1.21.3 yes
Could you show what it's outputting in an image
wait maybe im stupid I swear I did, well now it gives me both a jar file and the plugin itself.
like in this form
for example
where is that screenshot taken
from file explorer
windows 11
i mean the issue is half fixed, i get my jar file at least so if you have anything more important to do please dont bother helping xd. Thanks anyway tho
I mean in what folder
oh sorry im retarted, please dont take the file explorer comment as an offense, didnt mean it like that i swear xd. It was from my plugins folder. There a new folder called production was created and clicking through the files gets me there
Thanks for all the help, problem solved itself. Doesnt happen anymore. Really thank you, would have never come up with this. (Edit: nv issue came back xd, not the greatest issue so its fine)
How can I get the moisture level of a block in PlayerInteractEvent? I am trying to cast event#getClickedBlock to Farmland but I am getting this error: java.lang.ClassCastException: class org.bukkit.craftbukkit.v1_21_R1.block.CraftBlock cannot be cast to class org.bukkit.block.data.type.Farmland (org.bukkit.craftbukkit.v1_21_R1.block.CraftBlock and org.bukkit.block.data.type.Farmland are in unnamed module of loader java.net.URLClassLoader
Farmland is blockdata
so I cast event#getClickedBlock#getBlockData to Farmland?
Yes
for playing sounds, is it pitch then volume, or volume then pitch
Are you asking what order the args are in?
yes
You really should use your IDE for that
^^
Looks like your docs are missing
Open maven/gradle tab
And click download sources and docs
Should fetch them for you
ah
regardless
ok thx u
does anyone have experience using the mythicmobs api?
i'm trying to make an existing mob spawn and set it to a custom faction for various player factions in my world
idk if that is possible though since it seems like each mob only has one faction assignable
does anyone know why version.set in my build.gradle isn't recognized? I'm trying to follow the blogpost about using mojang remap
So i wrote up some code but I want it so when player mines Diamond ore it gives them a chance of getting "Nether-Star" I Want to rename it to something else like "GOD STAR" and change the lore to "Sell in shop for cash" I have everthing done already just need help changing the name and lore when item is recived. this is what i got so far
can anyone explain the difference between groovy and kotlin in context of gradle ? It appears my buildscript is using groovy
you can copy and paste your code to here, just make it brief and use code blocks (three `)
is one more preferred over the other/commonly used
like just staight paste it in the chat?
you'd probably need to make an item object first right and then change its name before giving it tot he player
Kotlin is the standard now
private final List<ItemStack> items = Arrays.asList(new ItemStack(Material.NETHER_STAR, 1), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR));
@EventHandler
private void onDiamondBreak(BlockBreakEvent e) {
Block b = e.getBlock();
Player p = e.getPlayer();
if (p.getGameMode() == GameMode.SURVIVAL) {
if (b.getType() == Material.DIAMOND_ORE) {
e.setCancelled(true);
b.setType(Material.AIR);
Player player = e.getPlayer();
player.getInventory().addItem(items.get(ThreadLocalRandom.current().nextInt(items.size())));
b.getWorld().dropItem(b.getLocation(), new ItemStack(Material.DIAMOND, 1));
groovy dsl used to be standard but nowadays kotlin dsl is favored
format it
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
format it with the codeblock "ticks"
like this
temp = null;
you can just use the command for that explanation 😛
That is
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes: ```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes: private final List<ItemStack> items = Arrays.asList(new ItemStack(Material.NETHER_STAR, 1), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR));
@EventHandler
private void onDiamondBreak(BlockBreakEvent e) {
Block b = e.getBlock();
Player p = e.getPlayer();
if (p.getGameMode() == GameMode.SURVIVAL) {
if (b.getType() == Material.DIAMOND_ORE) {
e.setCancelled(true);
b.setType(Material.AIR);
Player player = e.getPlayer();
player.getInventory().addItem(items.get(ThreadLocalRandom.current().nextInt(items.size())));
b.getWorld().dropItem(b.getLocation(), new ItemStack(Material.DIAMOND, 1));
Certainly some code
leetcode vibes
what is this trying to do
lemme just send it for u
I like the list that’s full of hot air
private final List<ItemStack> items = Arrays.asList(new ItemStack(Material.NETHER_STAR, 1), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR), new ItemStack(Material.AIR));
@EventHandler
private void onDiamondBreak(BlockBreakEvent e) {
Block b = e.getBlock();
Player p = e.getPlayer();
if (p.getGameMode() == GameMode.SURVIVAL) {
if (b.getType() == Material.DIAMOND_ORE) {
e.setCancelled(true);
b.setType(Material.AIR);
Player player = e.getPlayer();
player.getInventory().addItem(items.get(ThreadLocalRandom.current().nextInt(items.size())));
b.getWorld().dropItem(b.getLocation(), new ItemStack(Material.DIAMOND, 1));
thank you i cant figure out how to do that i guess haha
wait ur right
well, to the question, what is this code supposed to do
on block break he wants to drop diamond it appears or give a wither star he said
\nether star*
So i wrote up some code but I want it so when player mines Diamond ore it gives them a chance of getting "Nether-Star" I Want to rename it to something else like "GOD STAR" and change the lore to "Sell in shop for cash" I have everthing done already just need help changing the name and lore when item is recived. this is what i got so far
i think you need to make the nether star object first (item or something) and then change its name, before giving it to the player inventory
It is a object already in the game
random but ur pfp is so cute it looks like there's a cat trying to wedge its way
it works when i break a block i recive the nether star i just want it to be chaged to a diffrent name
no like a java object
just throw that in the code?
and then change its name from there and you can do
player.getInventory().addItem(netherStar);
or something
is there like an easy way to create nms patches for spigot that just works without hassle on windows
dereC4 could you call me rq i can share screen?
first things first do you know object oriented programming like just the coding concept
uh ok
wdym, I can make patches just fine on windows
without all mingw crap? tried to use the one built into git and it didn't work. at that point i lost the motivation
private static final ItemStack CUSTOM_ITEM = new ItemStack(Material.NETHER_STAR, 1);
static {
var meta = CUSTOM_ITEM.getItemMeta();
meta.setDisplayName(ChatColor.GOLD + "GOD STAR");
meta.setLore(List.of(ChatColor.GREEN + "Sell in shop for cash"));
CUSTOM_ITEM.setItemMeta(meta);
}
@EventHandler
public void onDiamondBreak(BlockBreakEvent event) {
var block = event.getBlock();
var player = event.getPlayer();
if (player.getGameMode() == GameMode.SURVIVAL && block.getType() == Material.DIAMOND_ORE) {
/* Is there any reason to cancel really? Uncomment it if you believe so
event.setCancelled(true);
block.setType(Material.AIR);
block.getWorld().dropItem(block.getLocation(), new ItemStack(Material.DIAMOND, 1));
*/
if (ThreadLocalRandom.current().nextDouble() < 12.5 / 100) { // 12.5% chance
player.getInventory().addItem(CUSTOM_ITEM);
}
}
}
@thorny vortex
horray i just helped him with understanding Math.random
I don't normally spoonfed people but I don't really have the patience to explain what is wrong with their original code lol, I'd rather they just look at the differences
Since they just drop the Diamond anyway there is no reason to cancel
you can just use git for windows to run all of it
i think the main thing was that the list of air was trying to simuate probability but there's no need since you can just pick a random number and give the item based on the results
I was thinking the same but they cancelled it on their original code so I followed suit
maybe they had a reason for that
and you dont actually need the list, you can just give each item individually esp since you want to have a custom name/item lore for the Nether Star
Shout out to weighted randoms
so complicated for just two items 🥺
ok so my turn
i made a custom wither skeleton mob, how do i spawn it into my world through say any placeholder event
right now it's meant to just stand there
you just get the world handle and then do addFreshEntity on it
I don't think you can create static field for that ItemStack
Level#addFreshEntity
why not
what's the difference between the addEntity and addFreshEntity
Is addEntity even a thing
was going to say
nvm looks like it is for the World itself but not handler
If you spawned two items and modified one of them, the second one could get modified as well.
I think it was something like this, someone please correct me, its late and I can barely function.
Pretty sure drop item makes a clone
He adds it directly to the inventory
i can barely function is relatable 😭😭
does anyone have any insight on how I could possibly remove a player UUID from the 'rewarded_players' in a trial vault? (i tried to upload a picture i couldnt though)
addItem seems to make a copy too, so shouldn't be an issue
if it ultimately is, then just cloning the item each time it is added should do
Alright then, good to know
good catch still, I had to open the spigot repo to check if it makes a copy because that could totally happen lol
We don’t have api for that yet
You’ll have to use NMS
don't know who was the person who asked about the countdown, but there's likely a better way to do that countdown lol
ah crap
private record CountdownStep(String message, float exp, int level) {}
private static final CountdownStep[] STEPS = {
new CountdownStep("§c§l1", 0.33f, 1),
new CountdownStep("§e§l2", 0.5f, 2),
new CountdownStep("§a§l3", 1.0f, 3)
};
private void startCountdown(Player player, NPC npc, AttackDifficulty currentDifficulty) {
int[] countdown = {STEPS.length};
Bukkit.getScheduler().runTaskTimer(Clutches.getInstance(), task -> {
countdown[0]--;
if (countdown[0] >= 0) {
var step = STEPS[countdown[0]];
ServerApi.getInstance().getService(ITitleService.class).sendSubTitle(player, step.message(), 1, 20, 1);
player.setExp(step.exp());
player.setLevel(step.level());
} else {
executeHit(player, npc, currentDifficulty);
task.cancel();
}
}
}, 0L, 20L);
}
where shoudl i set output directory for my buildtools (im trying to get remapped)
ok
Hey, am I losing my mind? Some classes just seem to not exist? Like for example EntityType
Cannot resolve symbol 'EntityType'
And when i go into my external libraries folder, I only find a EntityType.class file not the standard java file
Update IntelliJ
It’s on the latest version
I’m using Java 23
And I have the latest gradle version as well if that matters
I’ll double check this though, but out of curiosity why would it matter (I’m sure i have a pretty recent version)
Old versions had problems with enums and java 21+
Ah that checks out, the material enum has the same issue
Thanks! I’ll lyk if it worked
How do I check when a player is close to the border? I thought about checking that x/z equals 30m/-30m but that is extremely inaccurate because the player is not bound to go in one direction but instead they can go to the side / reach the intersection of corners
Maybe I can make a bounding box with 29999995 blocks (like a square) and check if the player is outside of that bounding box? Like a reverse world border? There has to be a better way..
this doesn't seem like a bad approach tbh
its not very intensive, it does what you want and its simple
okay, just thought there was a better way. thank you!
Can confirm, it was my IntelliJ version. Thank you so much! (For future reference, I updated to 2024.3)
so far one of the weirdest IJ bugs yet
Right? 😭 I was so confused
so from what I've read
you're not supposed to do anything in registerGoals with custom entities and NPCs? You have to register them in the constructor?
This is the way I do it, I add my custom goals (and remove some default ones) after the spawning
if you don't want to add the default entity goals, then no, you don't
if you do want the default goals and also want to add your own, then you just override it, call super.registerGoals and then register your own goal
how do you remove default goals?
by leaving the register goals empty i see
so we override it and implement nothing
is there any guide for goals in spigot like there is for databases/commands
or any good posts
I keep a list of all the names of goals I want to remove then after spawning I get the GoalSelector of the entity and remove the goal(s) if found. I will mention that my usecase for this is very specific so depending on what you're trying to do this method might not work
#
# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00000001989313d8, pid=89433, tid=39683
#
# JRE version: Java(TM) SE Runtime Environment (23.0.1+11) (build 23.0.1+11-39)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0.1+11-39, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C [libsystem_platform.dylib+0x13d8] _platform_strcmp+0x8
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/craftinators/Desktop/Barium/run/hs_err_pid89433.log
[37.940s][warning][os] Loading hsdis library failed
#
# If you would like to submit a bug report, please visit:
# https://bugreport.java.com/bugreport/crash.jsp
#
> Task :runServer FAILED
I keep getting this crash whenever I try and run my server?
goals are not part of the API so you wouldn't find much of a guide I suppose
hey fellas is there a better way to do this spawning for my custom mob (idk if it even works yet)
Location location = player.getLocation();
ServerLevel world = (ServerLevel) ((ServerPlayer) player).getCommandSenderWorld();
CustomWitherSkeleton customWitherSkeleton = new CustomWitherSkeleton(world);
try using java 21
are you using jetbrains runtime?
That’s what I’m doing rn, I think Java 23 might be causing an issue
probably is
I’m not sure exactly, I believe I’m using gradle or is that something unrelated
lol oops
How would I even go about that / what does that exactly mean
Also, java 21 did work!
temurin is a jvm vendor
what do you think caused the issue for java 23
¯_(ツ)_/¯
fair 
java 23 doesn't work well with MC, especially paper
That will just create a new CustomWitherSkeleton object, it wouldnt spawn it (unless you handle the spawning in the object itself)
Off the top of my head the method is like #addFreshEntity or something. I think someone sent the method name to you yesterday
do you do anything with the entity besides adding a goal
because if you don't, you might not need a custom entity at all
world.addFreshEntity(customEnt.getHandle(), SpawnReason.CUSTOM);
Was correct
yuh i got that part i was just wondering if i got the Level the correct way
later on im going to so it attacks only certain teams etc
set by constructor
looks correct then yes 👍
it's just that that is a lot of casting
lmao ur pfp is like doof from phineas and ferb
with squidward
Technically if you want it to "look" better you can do
ServerLevel world = ((CraftWorld) location.getWorld()).getHandle();
CustomWitherSkeleton customWitherSkeleton = new CustomWitherSkeleton(world);```
And yes lol
ok
Its possible to display blocks in any hologram (armor stand name)???
Name can only display text, but you could use a resourcepack with custom font.
(Also, if you're on newer versions, you should be using Text Display instead of armor stand)
This is something a bit different.
Depending on version, this either uses Item Display or just armor stand holding an item.
This way it's basically impossible to show an item within the text.
Players can have resourcepack that changes the scale of text and your item would not be aligned correctly then.
people saying dont recommend using armor stands because lag and its buggy not safe?
I don't understand the "buggy not safe"
But it is true that Display entities perform better than Armor Stands.
not sure if theres a guide to use the holograms plugin their api to make custom display plugin
some post on internet, most people recommend display entities over armor stands xD
Yes, they are much better
but to manage display entities can be some complex, mine one, the text still being displayed behind walls or if distance was a bit far, the text still there
:C
It's really not complex.
Look at wiki (or docs) to see what properties the display entities have.
I mean, you don't even need that.
Display entities are enough.
yeah, i just started so make sense using simple methods
does anyone knows a github opensource to know how to stackmobs
mine one its using like not efficient method :C , cannot figure it out how to do it properly, im just remove the entities to be stacked then making a single entitiy with "imaginary" stack amount, then uppon killed re spawn a new one .
That's how you do it
Just don't use the entity name to detect your entities
PDC or UUID
🤪 , the issue that i have its like, whenever I reset the server to shutdown then turn on, the "imaginary" stack amount got reset to 1
and mark your entity in the spawn method consumer so it's easy for others to track
olivo
oh
when spring 🙏🔫
never heard of PDC, using UUID on the otherside cannot make it work, i did them to be a custom entities, but
I glad to ask, what its PDC
?pdc
oh
this is
new for me , thanks a lot

im seeing that , to prevent that if player set a custon tag with 99999 amount, it will set the entitty to be 99999 amount xD
im so much afraid that uppon dead of that entity , the server will kabom
You don't respawn all the entities on death
you just spawn one with the tag and it's value lowered
ah, haha ok
yeah, thats makes sense
well i dont have the kill all stack at once function yet, but nice to know it
Why does my world not load using Bukkit.getServer().createWorld(new WorldCreator("worldName"));?
when are you calling that code?
its called when someone uses a specific command
So long as the code is not called async it will work fine
why cant i send images
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
its stops after "Preparing start region for level 1 (Seed: ...)
Usage: !verify <forums username>
that log doesn't look like a spigot log
also you called it testWorld but it's trying to gen level 1?
the world itself is called "test" but the "testworld" string has a different meaning for me
?paste the relevant code
does the server actually crash at that point?
so everything else continues to work?
yes
try delaying your teleport as you are on 1.8
also confirm your spawn location is valid
it does not even tp the player, I have to run the command twice to get tpd
yes, delay the tp
what do you mean with "valid"?
if i run the command twice, its trying to teleport the player and I am instantly getting a nullpointer https://prnt.sc/NcFQfDmjXjNH
https://prnt.sc/PFaweJs1zio6 oh yeah sus
String[] split = location.split(",");
String worldName = split[0].split(":")[1];
double x = Double.parseDouble(split[1].split(":")[1]);
double y = Double.parseDouble(split[2].split(":")[1]);
double z = Double.parseDouble(split[3].split(":")[1]);
float yaw = Float.parseFloat(split[4].split(":")[1]);
float pitch = Float.parseFloat(split[5].split(":")[1]);
return new Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch);
}```
I think I have to load the world before I return the location right?
when you call that your world does not exist
the file exists, but the world is not loaded at this point
ok yeah thank you i fixed this problem
selfrole Add or remove a selfrole from yourself.
cleanup Base command for deleting messages.
embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.
findcog Find which cog a command comes from.
names Show previous usernames, global display names, and server...
userinfo Show information about a member.
listcases List cases for the specified member.
reason Specify a reason for a modlog case.
permissions Command permission management tools.
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
thanks haha
Hey guys, how could i get all the blocks of a players own field in a map.. this field is in any map different and there is only one main point (that is the beehive a player can claim). Any ideas how i could do that? https://prnt.sc/bLUYiu1CceMd
I would need all the blocks their location stored in a list or map, within the wooden blocks.. only problem is that in any server the cords are different so how could i do that?
Are you asking about getting the blocks in a volume?
One second!
As you can see their are 2 bee hives and 2 fields, when a player claims beehive 1, i need to get the block locations of field 1 and not 2
Heya are we allowed to look for developers in this channel or in general?
how could i do that?
?services and check pins in general
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Link the beehives to a boundingbox
what do you mean with boundingbox?
?jd-s
declaration: package: org.bukkit.util, class: BoundingBox
A box with bounds
oh wow
so what i coùld do is look around the hive in a radius of lets say 5 blocks for a water source, add the boundingbox to the water source (the location) and expand the boundingbox by 1 in every direction, that way the boundingbox is like a 3x3?
how does plugins like ItemsAdder recognize from what spigot acoount the plugin came from? any idea?
like when you boot up the plugin? I'd assume they do some matching from ID to nonce
id from what?
thank you
is it possible to make a player hold a regular item the way they hold a loaded crossbow? (with both hands)
It probably is
Guys, my plugin is printing "null" when I execute a command but idk where from, help 😭
got any code?
Guys my nuclear reactor printing null pointer exception but idk where its from help!
yeah but idk what to look for
looked for all printing methods I knew and found nothing
Because you're inverting the value of stepIndex
bruh