#help-development
1 messages ยท Page 414 of 1
well yes
its the job of the event executor to call the listener
its point is like, timings
hm welp ok
I'll just do my stuff in the EventExecutor, it's only to test whether the getEffectiveMotd() method works, anyway
but yea, concerning you don't need it, people do funny dynamic event listener registration
how can i make a itemframe be on the ground
I think it's setFacingDirection
declaration: package: org.bukkit.entity, interface: ItemFrame
tnx
isnt setrotation for the item within the itemframe?
I guess
pretty sure thats not for the itemframe itself
is it possible to create a custom entity without NMS? I want to do it in Intellij only with SpigotAPI
If so, can someone send me a link?
public class Marionette extends Zombie {
public Marionette(Location location) {
super(EntityType.ZOMBIE, ((CraftWorld) location.getWorld()).getHandle());
setPos(location.getX(), location.getY(), location.getZ());
level.addFreshEntity(this);
}
}
If I have smth like this, how would I be able to, instead of it being a Zombie, make it so I can pass an EntityType through the constructor and spawn that entitytype
custom in which way
you can change it's damage or attributes
pathfinder, health, damage
extends Entity
ig
just entity?
I got an annoying issue with mockbukkit again.
I'm getting this warning from slf4j: https://paste.md-5.net/eqotuvizoc.cs
Ofc I tried to add SLF4j-simple, (using scope "test"), but then no test works anymore, instead I get this huge stacktrace: https://paste.md-5.net/ubejigidub.bash
Is there any reason why adding slf4j-simple breaks everything? And if so, is there any way for me fix this? (I tried version 2.0.6).
Here's my complete pom: https://paste.md-5.net/aboqigekul.xml
Don't think the constructor for LivingEntity has an EntityType parameter
?jd-s
think i need to go deeper
if the zombie has this parameter
then one of the superclasses has it too
I am not passing an EntityType to the Zombie class. Just a Level
it does
Oh, sorry then
Could someone help me figure out why MongoDB logger is not taking effect?
This is my pom
https://paste.md-5.net/atoqipoder.xml
The issue is that I am trying to disable Mongo's logger but for some reason it's not working
guys with which method Bukkit.getMinecraftVersion() got replaced?
have you tried these stuff? https://stackoverflow.com/questions/30137564/how-to-disable-mongodb-java-driver-logging
I did. I got classcastexception
did this ever exist?
yeah in 1.19.3
full stacktrace
sorry again, but do you know how I would convert from org.bukkit.entity.EntityType to net.minecraft.world.entity.EntityType
How can i do that Somthing happens on PlayerFishEvent only sometimes? Like a chance to do it or something?
no, it doesnt exist in 1.19.3
lol that's funny
then I think I used paper
just use random ig
what did it return?
the server minecraft version
It's causing error while enabling BlobLumber but code is borrowed from BlobLib
what's MongoDB line 84?
casting uncastable
1.19.3? 1_19_2_R0.1-SNAPSHOT?
1.19.3
w8 spigot doesn't have getMinecraftVersion()?
((LoggerContext) LoggerFactory.getILoggerFactory()).getLogger("org.mongodb.driver").setLevel(Level.ERROR);
this
?
I see. I'm using my McVersion class for this: https://github.com/JEFF-Media-GbR/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/McVersion.java
Can LoggerFactory be casted to LoggerContext then
maybe you need one more method or smth
it's toString method also returns "1.19.3", "1.19", etc
thanks
cool
https://stackoverflow.com/questions/30137564/how-to-disable-mongodb-java-driver-logging is what most people upvoted
The one liner
show your imports pls
bump 
Not
how can you cast it to LoggerContext without any imports?
anyone know if i can do something to get rid of the 'Class is never used' thing for the class extending JavaPlugin?
?
if i do @suppressWarnings("unused") it would suppress internal warnings too
is that some intellij stuff
which i never encountered
intellij
no clue
ah thanks
alternatively you can add the main class as "entry point"
but that never properly works for me
are the settings per project or global btw?
Sorry to bother again, but do you k ow how I would convert from
org.bukkit.entity.EntityType
```to ```java
net.minecraft.world.entity.EntityType
that depends on the "Profile" thing at the top of my screenshot
I have to explain. I tried this code yesterday. I am no longer using it since it printed classcastexception.
I am 100% that I perfectly remember copying the right imports from stackoverflow and copying the oneliner and then getting the classcastexception.
Then I went back and found that it points to the oneliner and what I remember is that in IntelliJ everything seemed fine but at runetime it had that issue!
getHandle() ig
usually it's only for the current project. if you wanna change it for all projects, go to settings from the "welcome screen" and change it there. It will only apply to new projects, though
By being fine in IDE I mean that there were no compiling errors or such
I also never understand how to properly change settings for ALL, including old, projects
oh you casting type
EntityType doesn't have the getHandle() function
want to get the type of an entity and create a custom entity using nms with that entitytype
ah found it
custom pathfinding but no casting reference
iirc the way to do it is just (NMSPath) entity
I guess this should work:
public static EntityType toNmsEntityType(org.bukkit.entity.EntityType bukkitType) {
return EntityType.byString(bukkitType.getTranslationKey()).orElse(null);
}
thx, I'll try it
sorry, but the org.bukkit.entity.EntityType class doesn't have a #getTranslationKey() method
I pull requested this and it got merged like a month ago, or two
so it's definitely available in 1.19.3
anyway, print out the results of this:
EntityType.getKey(EntityType.ZOMBIE);
org.bukkit.entity.EntityType.ZOMBIE.getKey();
maybe this would work:
return EntityType.byString(bukkitType.getKey().toString()).orElse(null);
ok, wait. I'll try that thx
I'll test that out
yall think this will work? https://paste.md-5.net/iculakizuq.cs
No
why
It spawns the creature right where the fishing hook is, at the water
yes thats the idea
You need to pull it to the player (if this is what you are expecting)
how would i do that
In order to pull it, a good idea would be to use entity velocity with a vctor
I will share you a piece of code I have
Thanks
Location playerLocation = player.getLocation();
double gravity = -0.08;
double distance = location.distance(playerLocation);
double a = 1.0 + 0.07 * distance;
double b = 1.0 + 0.03 * distance;
double x = a * (location.getX() - playerLocation.getX()) / distance;
double y = b * (location.getY() - playerLocation.getY()) /
distance - 0.5 * gravity * distance;
double z = a * (location.getZ() - playerLocation.getZ()) / distance;
Vector vector = new Vector();
vector.setX(x);
vector.setY(y);
vector.setZ(z);
player.setVelocity(vector);
}```
Refactor Player player with Entity entity
Props to snowgears, most of it was was possible because of their https://github.com/snowgears/Grappling-Hook plugin
Minecraft Bukkit Plugin: Grappling Hook. Contribute to snowgears/Grappling-Hook development by creating an account on GitHub.
https://paste.md-5.net/oxaraxirer.cs how does it look
do i put the Entity field as the "g" or the "mob"
LivingEntity is enough
No need to cast to Guardian
LivingEntity already extends Nameable (for setCustomName) and it also extends Damageable (setCustomHealth)
Also, you should not set health through this!
use LivingEntity Attributable
Like, mob.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(50.0D);
Having an issues with this code:
Bukkit.getScheduler().runTaskTimerAsynchronously(plugin, new Runnable() {
@Override
public void run() {
Breaker.getWorld().spawnParticle(Particle.CAMPFIRE_COSY_SMOKE, Breaker.getLocation(), 1);
}
}, 0L, 20 * plugin.getConfig().getInt("Breaker." + itemsName + ".time"));
This code runs is under the code for drops, im having 2 problems mainly, 1. the particle runs at infinite time and 2. the particle spawn randomly
If it doesn't update health, then use LivingEntity Damageable#setHealth(50.0D);
You need to track the BukkitTask, then cancel it whenever you wish to stop the particle to run
but theorticaly, if i run this after the time it would stop
If it has a random direction it needs an extra argument, I will give you more info in a bit
No
@Override
public void run() {
Breaker.getWorld().spawnParticle(Particle.CAMPFIRE_COSY_SMOKE, Breaker.getLocation(), 1);
}
}, 0L, 20 * plugin.getConfig().getInt("Breaker." + itemsName + ".time"));```
run task timer runs until you explicitly cancel it or the server stops
Now you have task, you can track it.
Once you want it to stop, you will do task.cancel();
If you need it to only run once, you should use runTaskLaterAsynchronously instead of runTaskTimerAsynchronously
use a lambda instead of a runnable, no reason to do it async too
ok i fixed it, works fine, but for the random spawn of particle helps to give a cool effect to it so probably im gonna keep it
Gotta save those precious microseconds on the main thread
microseconds are the most important thing in the world
Hello friends, do you know any good "image map api"?
Currently i'm working on a coupon project, where players can interact with fancy looking Material.FILLED_MAP items.
I tried the built-in map api, but somehow after a server restart, the map gets empty and won't stack with the new "same maps".
What about pizza?
please help, the guardian is not getting pulled towards the player
https://paste.md-5.net/fifujujazu.cs
How can I work around it? Mongo is using SLF4J because of HikariCP but not only that, HikariCP SLF4J dependency is omitted by another which I cannot find
oh man i had some good meme about logging frameworks but i seem to have lost it
birb
What could be the reason of the file not getting created with the content from its model class inside the jar resources
Because the exception is not getting thrown, so the InputStream is not being null
use mkdirs instead of mkdir
could be
mkdir only creates one folder at a time
and mkdirs also creates its subfolders
right, maybe its that
But i dont think, because is something related to the content
The config.yml is getting created with no exception, but with no content
And the code works perfect on Spigot (using Plugin#getResource() and Plugin#saveResource())
Same issue
๐ก
Try: Files.copy(stream, file.toPath(), REPLACE_EXISTING) ?
okay i will try
You should also try to close your streams
It might not be as bad with your case, but it can lead to problems
oh yeah, there is no try-catch that'll do that
How do i make a entity be pulled towards a player? My code doesnt seem to be working. https://paste.md-5.net/fifujujazu.cs
And my resource file is not even empty
Doesnt make sense, because the stream is not null too, so it must be copying the content
are you handling the exception properly? Like, are you throwing it into the console?
Yes
Like, it doesn't make sense. I hate struggling this hard
This is my pom
https://paste.md-5.net/manuzedaga.xml
This is the log
https://paste.md-5.net/atafacogow.md
This is the class
https://paste.md-5.net/wumigoganu.java
Is there actually content in the file? You could verify that by opening the jar as a zip
doesn't answer your question, but you should read it anyway: https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/
Yes its content
I already seem that
I mean i wont be asking for help without first looking the common issues
๐ค
shity bungeecord, why didnt they add the fkg getResource() and saveResource()
get rid of the if (getClass()...) line
you are checking whether it is null twice
thank you good man, would you happen to know the answer to my question?
the first if-statement where you check whether the stream is not null
and I guess that it is actually null and you don't notice
invalid name, I would say
No, because of your first if-statement
it never reaches that point
get rid of it and try again
okay
makes sense
okay you where right
But now i have to find the why the stream is not opened
๐ It's funny how nobody noticed that
Note that getClass() is relative to your current class package
you should use Plugin#getResourceStream()
Then start it with a tailing slash /
I dont like their shity api
/my/cool/config.yml
ya that should work
Also really thanks man, if where another will told me to ask shity paper support
They comm is so shity lmao
subtract the entitys location.toVector from your location's toVector, normalize it, then use that velocity
or maybe the other way around
please put yourself into our position
imagine if you would receive that message
would you understand what the context is with a single random line of a stack trace and a single random line out of a larger problem?
Anyone here with some cool plugin idea's?
it depends if you want something original i guess!
and it was not in the random line of code you sent
that's why people said nobody can help you if you only send one random line of the stacktrace and only one line of code
I want to make a minecraft plugin that I can work on for a while, a plugin small scale but with many features.
a plugin with which you could order food in real life would be cool
xD
wdym with "write text with java on a website"?
like a http request?
i often use URLConnection directly :P
๐
the http client sounds good, i should learn it!
often i'm using java 8 for compatibility though
v 1.8 be like ๐
But i code 1.8.8 plugins so i cant complain
I never understand the versioning tho
<1.13 likes to throw errors if you run any minimally recent version of java
rcon drivers do some funky stuff with java internals iirc
rcon?
idfk
you just need to disable native-transport don't you?
Dont fuck usar WebSocket >
rcon shouldn't use java internals
does it still exist? xD
i remember using it before
who tagged? i seen the ghost pong
hmm
So, who uses rcon? ๐
people use rcon?
So far yes, from what imlussion have said
Idk what means, but WebSocket >>>
Full duplex technology, bi-directional, good error handling, what more we can expect about it
cool
You have to like
I should code my own command to teleport to my world?
Specifically register it with multiverse
Ye
Or you can use vanilla commands
try
/mv import worldName NORMAL
for some reason it isn't generating world :c
and only 1 bedrock (i think ik the fix for this)
ig that's bedrock in the middle of the chunk
Every method listed above as well as getBaseHeight(WorldInfo, Random, int, int, HeightMap) must be completely thread safe and able to handle multiple concurrent callers. Some aspects of world generation can be delegated to the Vanilla generator. The following methods can be overridden to enable this:
shouldGenerateNoise() or shouldGenerateNoise(WorldInfo, Random, int, int)
shouldGenerateSurface() or shouldGenerateSurface(WorldInfo, Random, int, int)
shouldGenerateCaves() or shouldGenerateCaves(WorldInfo, Random, int, int)
shouldGenerateDecorations() or shouldGenerateDecorations(WorldInfo, Random, int, int)
shouldGenerateMobs() or shouldGenerateMobs(WorldInfo, Random, int, int)
shouldGenerateStructures() or shouldGenerateStructures(WorldInfo, Random, int, int)
or at it's 0/0
shouldGenerateX to false on everything except Surface
hmm
.
What do you mean?
'you need to reset via jira not stash
public class DeepDarkChunkGenerator extends ChunkGenerator {
public void generateSurface(WorldInfo info, Random random, int x, int z, ChunkData data) {
for (int y = 51; y < data.getMaxHeight(); y++) {
if (y == 51) data.setBlock(x, y, z, Material.BEDROCK);
else data.setBlock(x, y, z, Material.AIR);
}
}
}```
You'll need to generate your own noise for that
so you have a roof
hmm
Ooh, now I am able to log in as well. Thanks
is it possible to modify the already existing one?
fuck
Although you might be able to recrate it with Spigots https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/noise/NoiseGenerator.html
Can anyone help me pull a Entity towards a player please? I cant get it to work. Im desprate
https://paste.md-5.net/pokavaloni.cs
what's the issue with that code
Note that the velocity isn't as strong when the entity is in water
and you are just multiplying it with 1
the velocity is so small that you don't even notice a change
ill try it
Why, doesnt disable the shity mongo logger? ๐ก
Logger.getLogger("com.mongodb").setLevel(Level.OFF);
one question
in chunkgenerator, is there a way to modify just x blocks not all?
let me rephrase. how do i generate the namespacedkey for Enchantment.getbykey? do i use the deprecated method and do getByKey(new NamespacedKey("Minecraft",enchantment) ?
I having the same issue as my friend @quaint mantle
But pretty stupid the issue, because the logs arent displayed on one of my old plugin, but now i created a new plugin with the same logging disable code, And they still appear
I believe there should be a specific method for getting a "minecraft:" key. Unfortunately I just don't remember what it's called. If you can't find it then that deprecated version should work.
Any answer are appreciated
NamespacedKey.minecraft
Yeah that one 
anyone know if it nulls or excepts if the key is wrong?
Mongo is trash
null
I hate it
How could I make so setting the ChunkGenerator of a world to modify the existing chunkgenerator and not override it completely?
cant u do stuff in ChunkPopulateEvent or smth similar?
hmm
idk
let me read the docs
brb
what does populates mean?
too many new words
First the base terrain is generated
Population adds all the fancy decor
Trees, Structures, etc
let me explain what I need it for
rn I have a generator that generates an only deep dark biome world
but I would like so it has a roof (like the nether one, bedrock and above of that bedrock air)
but when I try to set ChunkGenerator for a custom one it (obviously) overrides the original one
Yeah you'll want your own noise system
would be any way to modify the default one?
my Entity isnt getting pulled to the player what do i do?
https://paste.md-5.net/jehaconivu.cs
ignore the if(player instanceof Player) it is temporary
Why are you not using the code I provided before?
editing it dont work
Subtracting the two vectors should work
You may need to play with he multiplier to get it how you want
I cant understand
Have you worked with mongo?
Does it move at all with just 1
nah
it spawns a creature
But what doesnt work bruh, sorry tho
if we dont know what doesnt work, its imposible to help
if you find it ping me, I will be trying other ways
bro read first man i said it doesnt pull it to the player
But thats not enought information for helping
Could you please make a clip?
its on my old pc. IIRC i did some nonsense on chunkload since i could just check if a ceiling was generated or not
is your player above the spawned guardian
i dont have more information i sent the code and my issue what else is there
and then chang or dont change it respectively
what no
did it work right?
maybe there's wall between player and guardian or smth
doesnt
You need to spawn the entity
yeah ig
it did, i shelved it cuz i didnt understand perlin noise. Ceiling generated fine. It was in the nether, so i just copied the ceiling to higher up. I'd recommend you just clone and mirror the bedrock layer
Where im really interested in
wow
like cast magic
It is in the world
summon
Before pulling it to the player
You might have to delay the velocity by a tick
I mean, I did it on ChunklPopulateEvent and it worked
afair i already gave some to you
but laggy af
am i not doing that
Wait im wondering to ask if you worked with Mongo?
No
Yes i remember, but i want to learn more
sql OP
This is only needed for consumer
Sql for small projects, scalabiles projects should be NoSQL
so what do i do
try suggestion above
Before applying velocity
delay for 1 tick
cover your setVelocity with
Bukkit.getScheduler().runTask()
so it will be delayed for 1 tick
It's not required
It can be runTaskAsynchronously
Velocity can be applied asynchronously
It will be called to another thread
runTask runs in main thread
ok and
๐คท๐ป
I mean you are sending a single packet
We don't know if that guy expecting their server to be a fishing gamemode
You aren't going to nuke the server
@young knoll getting back to your suggestion
could I make a noise generator that is identical to the deep dark generation and just modify it as I want?
reverse engineered vanilla generators huh
well then just go to random YT guide on minecraft noise gen
Heya, i have a plugin that counts how many deaths you have and when you reach a certain amount of deaths it kicks you constantly until you get revived, it works until you get revived then gets stuck and doesnt go down after the first death, can someone help
or to any noise generator
??
reverse engineered vanilla world generator go brr
how do you do that?
sources magic ig
f4
its minestom anyways so i wonder if you could use it anyways
f4?
in intellij
thats too much anyways in a sentence
ide key. 'Open class'
nop, doesnt do anything
^^
maybe u need sources in ur .m2 folder
is it spigot api?
i always do --generate-docs --generate-source
so when you die it adds a number to an int value in the config file, once you reach 7 deaths it kicks you and doesnt let you join again, there is a revive gui that shows banned players, but once you get revived the deaths stop counting and the config doesnt update for that player
cant u store something as small as that in the PDC? or better yet just use and reset death statistic?
yes
I want it to be easily editable but I guess i can use that
im no wizard but im fairly sure i am following that constraint??????
Caused by: java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: FROST_WALKER
Yes?
.toLowerCase them
^
so why cant i get a enum with CAPS
You can with valueOf
Player player = (Player) commandSender;
String number = strings.length == 2 ? strings[1] : "1";
if(strings.length == 1 && number.matches("[0-9]+") ){
int eNumber = Integer.parseInt(number);
Enchantment enchantment = Enchantment.getByKey(NamespacedKey.minecraft(strings[0]));
if(enchantment == null){
player.sendMessage("Please define a EXISTING enchantment.");
return true;}
But this is different
declaration: package: org.bukkit.enchantments, class: Enchantment
keys are weird man
why is the string parameter in Enchantment#getByName nullable lol
cuz it returns null if you enter null
To get a null enchantment
and my question is: why does it allow to pass null?
why would anybody think "oh, yeah, let's see what the Enchantment is whose name is "null"
failsafe most likely
idk almost all other methods have NotNull parameters and throw IllegalArgumentException or similar when the input is null
one question guys, when I use the method ChunkGenerator#generateSurface the ChunkData parameter, returns the chunk that was originally created or is it a blank one?
shouldnt it return a chunk thats not connected with the world yet?
idk that's why I am asking
if I don't do nothing with the ChunkData
should it just generate the normal world?
or I am getting confused
No
you need to set shouldGenerateSurface to true
public boolean shouldGenerateSurface()
Gets if the server should generate Vanilla surface.
The Vanilla surface is generated before generateSurface(WorldInfo, Random, int, int, ChunkData) is called.
This is method is not called (and has therefore no effect), if shouldGenerateSurface(WorldInfo, Random, int, int) is overridden.
Returns:
true if the server should generate Vanilla surface
So if you set that to true then you will have a ChunkData with the vanilla surface in generateSurface
hmm, so ChunkData is only available before the chunk gets created?
yes
hmm
do you mind explaining me how could I make the same noise generation as vanilla one?
cant u clone the vanilla chunk generator
Some aspects of world generation can be delegated to the Vanilla generator. The following methods can be overridden to enable this:
shouldGenerateNoise() or shouldGenerateNoise(WorldInfo, Random, int, int)
shouldGenerateSurface() or shouldGenerateSurface(WorldInfo, Random, int, int)
shouldGenerateCaves() or shouldGenerateCaves(WorldInfo, Random, int, int)
shouldGenerateDecorations() or shouldGenerateDecorations(WorldInfo, Random, int, int)
shouldGenerateMobs() or shouldGenerateMobs(WorldInfo, Random, int, int)
shouldGenerateStructures() or shouldGenerateStructures(WorldInfo, Random, int, int)
Set all those to return true
I've nto looked but surely you can call super
so that would just generate a normal world if I set all of those to true (like if I never used the ChunkGenerator)?
Yes
hmm
But only with the biomes in your biome provider
I wish there was a way to get the vanilla ChunkData
I remember 4 years ago trying to modify the default worldgen to exclude oceans
and then modify it as I want
and it was not fun
but I was also like 13 at the time and knew about 3 things about spigot
lol
Worldgen is half black magic to me still
so @young knoll one last question before I try to make my own generator
is there a way to "intercept" the vanillla ChunkData and modify it as I want?
Yes
This method
It should if shouldGenerateSurface returns true
Granted the surface is for stuff like placing grass and dirt
For the actual shape of terrain you want the noise methods
Are there any good resources to provide to users for how YAML works and why things need indentation? I'm trying to help a user of my plugin and I don't think they understand why indentation is important.
shouldGenerateNoise , generateNoise
just a single layer of bedrock
You can still do that with the noise method
is it difficult to do?
Should just be some loops
hello. Is there any way to quickly serialize itemstacks?
They are config serializable
means?
Means you can serialize them to yaml already
I'd like to serialize them to a json file
Ah
write your own serializer
I am able to use gson, but sadly I do not know how to serialize itemstacks
Well you should be able to use similar code to what spigot uses for YAML
not too much work with gson
I am very confused @young knoll
like there are sooo many options needing to get checked and serialized
isn't that hella outdated?
ItemStacks are ItemStacks and Gson is Gson
I'd also be fine with just writing some base64
I do not care about readability, I just want it to be able to save and read
Well
You could use BukkitObjectOutputStrem to convert it to bytes
Then base64 that
Just create a TypeAdapter and register it
and store that somewhere
that thread covers it
already doing that, but that takes forever to create
counting in all the different options an ItemStack can have
Why does this only generate void?
public class DeepDarkChunkGenerator extends ChunkGenerator {
public void generateSurface(WorldInfo info, Random random, int chunkX, int chunkZ, ChunkData data) {
for (int y = 51; y < 320; y++) {
for (int x = 0; x < 16; x++) {
for (int z = 0; z < 16; z++) {
data.setBlock(x, y, z, Material.AIR);
}
}
}
}
public boolean shouldGenerateSurface(WorldInfo info, Random random, int chunkX, int chunkZ) {
return true;
}
}
``` @young knoll
The TypeToken handles all teh meta deserialization
you don;t have to do it manually
Change it to noise instead of surface
Is it possible to get nearby packet armorstands?
it was
Packet armor stands only exist on the client
it was bad tho
I modified it
some advancements
Does anyone have written tutorial suggestions for making plugins?
yes
You would have to keep track of the EntityArmorStands yourself
are this
shouldGenerateSurface() or shouldGenerateSurface(WorldInfo, Random, int, int)
shouldGenerateCaves() or shouldGenerateCaves(WorldInfo, Random, int, int)
shouldGenerateDecorations() or shouldGenerateDecorations(WorldInfo, Random, int, int)
shouldGenerateMobs() or shouldGenerateMobs(WorldInfo, Random, int, int)
shouldGenerateStructures() or shouldGenerateStructures(WorldInfo, Random, int, int)```
true by default?
hi i need some help
WorldCreator#generator(new ChunkGenerator() {}) you would have void
Yes
what does it change tho? Because with generateNoise didn't used @Overide but still worked
im making a plugin and one of the features is when a tripwire hook is placed, it triggers an event that finds the placed block and removes it so that it acts like a key. I've tested the plugin and there are no issues. The issue im having is when the server has the customNPC's mod, none of the events register. Does anyone know the fix to this?
yo my entity is still not getting pulled towards the player i tried everything. Anyone ever done this before?
https://paste.md-5.net/xinocemute.coffeescript
YOOO @young knoll
show
?
this is the only code remaining from yours
hehe
is it possible to get a list of blocks from BoundingBox?
loop through all of them
it is in water and all it does is the mob spawns and it looks at me
then it starts moving as normal
is there a way to send a message to a player without it appearing in their log console or whatever its called
What I did was set the mob's velocity to the velocity of the caught item 1 tick later
Why is my use of PacketPlayOutRelEntityMove jerky?
And then remove the caught item
The entity still jolts
return new PacketPlayOutEntity.PacketPlayOutRelEntityMove(entity.getId(), (long)(4096*(x-oldX)), (long)(4096*(y-oldY)), (long)(4096*(z-oldZ)), onGround);
oldX is entity.lastX
x is entity.locX
Sending on every tick
maybe water blocks velocity or smth
try spawning mob in the air and check if it's pulled towards the player
can you set max building y?
what do you mean exactly? what would i loop through
Loop through the xyz from getMin to getMax
yeah that
can I set max build height of a world?
You can with a datapack
i dont think its the water i spawned it 3 blocks above, it still didnt pull
Idk if you can with the api
By any chance does anyone know changes that are made to location.subtract()/add ?
They seem to act differently in 1.19.4
a bit higher than usual
I doubt anything changed
they are still same
Then I guess the armorstand nametag place has been changed
you probably forgot to clone
it used to be down, but it's up now
What do you need it for
armorstand nametag for holograms
Use TextDisplay for holograms
I'm just trying to see if something is changed in location or armorstand
Since I didn't change any values, but the text seem to be a bit higher
which I feel it's from add/subtract methods of location
How to make a close-proof inv?
I refer to when the user closes the inv, give back his items
?
When it's closed, loop over all the slots you want and grab the item in them, then give them to the player
player can place items in this inv?
yep
does your inv has custom holder?
what is a custom holder?
ye the problem is there bro
i just dont understand this inventoryholder stuff
and i need the plugin like for the friday
show your inventory creation code
You shouldn't use holders to identify your inventory
it's literally like 2 mins of coding
why
i only do that using holders
all the time
Because that isn't what they are designed for
but who asked
it's like super useful
You should use the inventory instance itself, or the view returned from openInventory
๐คฎ
?paste
i use holders so i don't track instances
well if you are not using custom holder you need to create a list of itemstacks
attached to a player
so you would need a hashmap
What
<Player, List<ItemStack>>
yes
and just add itemstacks to this list when player drags items into your inventory
Its just 2 items
and well, the player
and when player closes the inv remove his entry for the map and give items from the list
ok
Tis a good resource
I saw that but i dont understand
so guy just used an inventory handler
and a hashmap
and i suggest just using a holder
Okay so maybe i just use a map but how tf i can get the items out of the if statement?
nvm
just thought a little bit
you just add items to the list as player drops them at the inv
and when player closes it, just loop through list and give items back to the player
and remove map entry
ahh i see
yee
sorry for the bad question but i've never managed maps, how i add elements?
<Key, Value>, right?
Map#put(key, value)
Thanks.
hey i need some help. For some reason the customNPC's mod is causing the events in my plugin to just not do anything at all and I have no idea why
how can i fix this aside from removing the mod
@EventHandler
public void OnEnchanterMenuClose(InventoryCloseEvent e){
for (Player player : items.keySet()) {
List<ItemStack> itemsList = items.get(player);
for (ItemStack item : itemsList) {
if (player.getInventory().firstEmpty() != -1) {
player.getInventory().addItem(item);
} else {
player.getWorld().dropItem(player.getLocation(), item);
}
}
}
}
This should do?
only one player is closing the inventory
List<ItemStack>itemStack = items.get((Player) e.getPlayer());
Player p = (Player) e.getPlayer();
for (int i = 0; i < itemStack.size(); i++){
ItemStack item = itemStack.get(i);
p.getWorld().dropItem(p.getLocation(), item);
}
look
Is it possible to get nearby packet armorstands?
Not unless you keep track of them somewhere
Well, i do have them on a list.. problem is in making an animation that should spin a random about. Then remove every single armor stand but the top one.
If that makes sense.
I'm thinking on integrating my scripting system with my menu engine and being able to make scripts in-game 
how awful would it be
Loop through the list and check the distance
Distance is same all over :/
What
Ill send a vid of the animation.
This is with a fixed value btw.
Dont mind the goofy heads its a old vid.
Why do you need to get nearby ones if you already have a list of them all
With a timeline system, we'd probably make a Set<UUID> usedEntityIds that would keep track of all the entities that need to be removed when the timeline is done
Thats the only way i could think of getting it if i don't know which one is at the top.
Check the location of each?
Yeah I do have a value to each. Problem is if i rotate it a random amount. How would i know the value of the top one?
Ooh good idea.
ordered list, maybe?
Its ordered from 1-8 already :p
or that would be 0-7 but
yeah
Haven't really found out yet, but im thinking rotating it by intervals of 45. Because thats how many degrees that between each.
Uuh i could do that yeah
Please!!! I need some simple help, its struggling me
Because its throwing the params lenght exception, when the param is only 1
๐ค
ehh annotations
I'd probably just make a subscription system
no need to overcomplicate things
please i know what you think about it, but i need to fix this ๐ฌ
I think about a different system :)
Won't fix yours because I'd never do it that way and don't know how I'd use it
Thats line is exception is being throw but if you see on the cap about the listener just isten 1 packt
Don't methods have like, an implicit first param
no clue, print out the params
that's how you debug things
instead of crying you figure out why it's failing that check
I'm still thinking how I'll make the menus for the scripting system 
maybe on a particular day where I'm mentally instable and feel like linking 15 menus together
proper debuggers are for memo leaks
also proper debugs are for stable proejcts, not just for temporary projects
oo I upped my daily avg from 2 hours to 3 hours today
What is that?
I see
and puts it in a fancy dashboard
Why is gradle a language
build.gradle
Just got it.. took me 4 hours to fix a simple little thing lol
Yeah but that is groovy
joshi told you about that days ago
it just reads file extension
not really
(Or kotlin)
...
the only part I don't like is the funky visualizers
Oh heck yeah
๐ก
Psychedelic word cloud
print them out
What?
I must've been mentally unstable on aug
Either that, or you had no errors the whole day...
exceptions arent errors
but yesterday I wrote this entire scripting system and it worked first try
and it made me extra happy
True
hes grown too powerful he must be stopped
illusion
yea
how many hours do you have on ur wakatime
today I was adding new functions and forgot to increment my shit
total?
since you joined
fucks wakatime
time tracker
you can graph my seasonal depression based on my commit activity alone
im only at 145 since jan 2nd
This is pure coding time right? it doesn't count testing and stuff
I was feeling extra sad around sept - dec, and mid-jan to march
uh yeha
this year?
i have a github but im too lazy to connect it to my shit
this is jan 2nd, but 2 years ago
We love depression killing motivation
so occasionally stuff breaks and i do it all over again lol
yes
lemme see
you can see where i went on holiday
u almost made amogus
basically same ๐
Mine is so dead
you beat me
get fucked
yes I have the monthly subscription
imagine having money
whats the blue project
it's my main project atm
what does it do
and the green project is my main project, but on my school laptop
a lot
core features
pick one
where do u live again
Portugal
we havent seen hide or hair of school laptops here
my "school laptop" more like the 1k$ LG Gram that I bought to work in class
ah
you meant 'laptop USED for shool'
laptop I bought to use in class instead of actually doing shit
i did the same damn thing
brought my own and a lan cabble
whatever computers they have has no redeeming qualities
Oh it's an IDE plugin
at least the 2015 variants were encased in 1 inch of solid plastic and pretty much indestructible