#help-development
1 messages · Page 17 of 1
I use groovy too

excuse me if I started making plugins in like 2016 and there wasn't anything much better
maven 
lol no
me who started in 2018 ( or so ) and clicked random Build Thingy
nah i mean to learn kotlin gradle but ughhhhh things
maven gut
maven is just simple
so are maven sometimes - it will just give no error message and mark the project as invalid
Never had that issue
i did the other day, i was trying to put modules in modules
and it threw a tantrum
but it accepted it eventually
but that way i could have an nms module with different sub modules and the nms module could do all the version logic
override registerPaths
also please take a look at this:
https://www.spigotmc.org/threads/tutorial-creating-custom-entities-with-pathfindergoals.18519/
.
priority
it goes through all added goals, then takes the one with the lowest priority that returns true for "canUse"
Show your code
Mhhh
this.goalSelector.addGoal(3, new DashToPlayerGoal(this,2,this.getBukkitEntity().getWorld(),10,20));
this is my code which adds my custom goal to index 3
then attackgoal is index 0
follow 1
Priority not index
yeah for example. e.g. for villages, "run away from pillager" is more important than just "just randomly stroll around", and "go back to village" is more important than "just randomly stroll around" too
custom goals
Custom pathfinder goals is here! I went very in-depth the best way I could to explain how custom pathfinders work. I hope you all enjoy and understand the video :D Thanks for watching!
P.S
Sorry about the damn zombie noise in the background forgot I had my mc sound on :(
Want more videos?
Become a Patreon support to gain access to more videos!...
its all google
write a book
I don't know anything about pathfinders
i thought of creating resource
but I realized im lazy piece of shit
only yesterday did I write my custom wrapper for them so I can use them without NMS
before that I had no idea how they work
that codedred video helped a lot to start creating custom goals ..
"my own custom goal"
this isnt vannila
I coded this thingy
yep
imma send u all goals
TempGoal
Used by vanilla for pigs and sheep
but I encourage u to try and code custom goal
by doing so, you will get some knowledge of how pathfinder goals work
java docs
or IntelliSens
oh sorry i meant nms.screamingsandals.org
has something for that
thats the point of obfuscation 🙃
but for me personnally it suggests correct names
ask mojang
oh sorry
nvm
i forgot u needed variables, not methods
but u can still find in code that if this.d = var2
then var2 is speedModifier
it follows player that tamned the mob
nms player can be used as mob
i think
not .class
just get ur player
nms Player p = ((CraftPlayer)bukkitPlayer).getHandle);
and feed the goal with nmsPlayer
thread pls
All of it
And not in a screenshot
All lines?
All of the config code
Uhh the config
?paste
^
if(damager instanceof Player){
plugin.getLogger().info("Damager is player");
if(entity.getType() == EntityType.BLAZE) {
plugin.getLogger().info("Its a blaze");
Player p = (Player) damager;
JobsPlayer jobsPlayer = Jobs.getPlayerManager().getJobsPlayer(p);
Job job = Jobs.getJob("Hunter");
if (!jobsPlayer.isInJob(job)) {
plugin.getLogger().info("Player not in hunter job");
Long unixTime = System.currentTimeMillis() / 1000L;
if(!messageCooldown.containsKey(p.getUniqueId())) {
Long expirationTime = unixTime + 100;
messageCooldown.put(p.getUniqueId(), expirationTime);
}
if(messageCooldown.containsKey(p.getUniqueId())) {
Long lastMessage = messageCooldown.get(p.getUniqueId());
Long expirationTime = lastMessage + unixTime;
if(unixTime < expirationTime){
return;
}
}
// messageCooldown.remove(p.getUniqueId());
messageCooldown.put(p.getUniqueId(),unixTime);
p.sendMessage(ChatColor.translateAlternateColorCodes('&',"&7[&eReminder&7]: &bDon't forget to do &6\"&b/jobs join Hunter&6\" &bto earn extra money!"));
}
}
}
public static Map<UUID, Long> messageCooldown = new HashMap<>();
can anyone see anything obvisoly wrong with this
my message just doesnt seem to be sending
@chrome beacon
A blaze is never going to be a Player
ah damagee and entity. different
Use a cooldown with the Bukkit Scheduler
I think is better
Its easier if you tell us what problem you are having, rather than post a bunch of code and ask us whats wrong.
get the config in the on enable
Also I'm not sure of an inventory is serializable
Store the items
for(Player players : Bukkit.getWorld(worldName).getPlayers()) {
if(players != player) {
player.sendMessage(prefix + "§cDie Welt in der du dich befandest wurde gelöscht! §7(§e" + worldName + "§7)");
player.playSound(playerLoc, Sound.NOTE_BASS_GUITAR, 1 ,1);
}
}
why am Im only I getting the message (player) and the others dont
i did tell you whats wrong
"my message just doesnt seem to be sending"
Because you're not sending it to the player in the loop
Because you are using player inside the loop rather than players
This is why good variable names are important
It does
it works
just after the reload it gets lost
works thx
sure?
whats gonna happen if i replace every instance of Player with OfflinePlayer
in my code
wait nevermind
Anyone have an idea how I can do when I do Build Artefacts (Intelij IDEA) that sends directly to the test server on my machine via SFTP?
putty script
have you exemple ?
All I have is a CD script for a self-hosted gitlab endpoint
that makes a batch file that deploys to production
anyone knows why 1.19.1 doesn't print any stacktraces anymore >.<
ddos him
let's go!
if i need to get the OfflinePlayer instance of a player via only their username and no UUID, will Bukkit.getOfflinePlayer(UUID.nameUUIDFromBytes(username.getBytes())) work?
Someone knows how I can make it accept the "null".
for real wtf why does it not print any stacktrace
Integer instead of int
then you can pass in null
yeah use the wrapper for int
ooh okay
a primitive cant be null
i used Integer and can use null
thank you bro 😅
i'm begginer in java
@echo basalt okay thanks!
no
just use the name of the player
might be running async
deprecated
Thread.setUncaughtExceptionHandler((thread, throwable) -> { ... });
doesnt matter
I have an ExceptionLogger class
perhaps you catch them? xD
eyo can someone tell me what this does? https://github.com/nodusclient/girlboss
hope its correct channel
(looks like client side pms?)
looks like it
I would like to report a bug/code flaw in spigot/bukkit, where can I do so?
?jira
Only in offline mode servers
I'm using NMS' PathNavigation#moveTo(x,y,z,speed). I set the speed to 1 for both villagers and llamas. The llamas are extremely slow, the villagers are very fast. Anyone know how to make the entities walk in their "normal" speed?
Try their speed values from the wiki maybe?
then the llamas would be almost standing still
IIRC the default value for llamas should be something like 0.3 or so, but even with 1.0 they are extremely slow
for villagers, using the Attribute.GENERIC_MOVEMENT_SPEED seems to be pretty accurate, but for other entities, they are sooo slow that they'd almost be standing still then
yeah it's weird D:
Check the base NMS class, does it have speed values?
oh yeah, Villager e.g. has a public static final float SPEED_MODIFIER value
uuugh why isnt it part of any interface
Any advices how to minimize a plugin jar? Mine is pretty big (10,6MB) considering i only have a few classes and other jars of much bigger plugins are only around 500KB (i.e. CoreProtect).
exclude packages you dont need
I already enabled the minimizeJar configuration for the shading execution in my pom.xml which reduced the jar to about a quarter of its previous size (about 40MB)
and ofc not every entity has this field at all
In the pom.xml?
yes
Exclude it from the shading or where exactly?
looks like you're shading spigot or sth
?paste your pom
yes probably i decompiled my plugin and it looked like it still had all of the spigot classes
I compared it with coreprotects plugion
well welll well
dont just shade everything in anyways
mark the stuff which is already there as provided
Do i just exclude the entire spigot?
no
no you mark it as provided
just set the proper scopes
set the scope
as said, paste your pom
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
you added spigot 1.13 with scope "compile"
just add <scope>provided</scope> to your spigot dependency
i do have that
see?
also why do you have spigot-api 1.8 and spigot 1.13?
you should only use one version
only the api?
depends. do you use any NMS stuff?
not sure why i included both
if no -> only use the API
https://github.com/nodusclient/girlboss
Girlboss is a mod that lets you detect when someone sends a private message to another player and attempts to detect who the receiving player is. The detection of someone sending a message is achieved by listening to "header packets" which are sent whenever a private message is sent. The detection of who ...
i remember
well just comment out the "spigot 1.13" thing, see if it still compiles. If yes, you don't use nms 😄
it appears it lets you expose who is sending private messages?
Ill exclude the api then
if you'd use NMS, then your plugin would run only on 1.13 and not other versions
I remember i do use nms
shading the spigot api 🤤
For log4j
they are shading the full 1.13 server
lmfao
yeah wtf, it lets you view who is sending private messages to eachother. How could Mojang mess it up this badly?
Chat signing 👏
I removed the api and it did compile
yeah of course, you should have removed spigot instead of spigot-api if you don'T use NMS
spigot-api is part of spigot
Never shade spigot it's there in the server for you if you need any dependencies it uses you can use them even if you don't shade them since they are provided to you through spigot
I do use nms for hooking into log4j
Again, why not depend on log4j then
It is an option lmfao
whats the dependency for it
Why use log4j at all in a plugin? Just use teh logger
We have an entire thread about that, dont you remember
👀
I've seen no thread
I do remember talking to somene about hooking log4j
but you shoudl still not need nms to hook into log4j
Whats the maven dependency for it
you cannot just use the log4j dependency unless you shade it, because spigot has it relocated to a different package name
I need both the log4j-core and log4j-api right
why does this happen, whitelist isn't even enabled
Plugin then probably
weirdest thing is I deopped player1, but player2 got kicked
these are all my plugins, I don't think any of them are doing that
wait 1.19.1 actually doesn't give stacktraces wtf
i thought it was an edge case
Probably just a bug
yeah but it's a terrible guh
and included both log4j-api and log4j-core
bug
sucks so hard. I have just wrapped all my command executors that need testing into a try/catch myself
oof lol
I dont need the log4j-api apparently
oh wow
My pluigin is now at a single kilobyte
no
no way
As so?
saveDefaultConfig()?
?
and then adding defaults afaik
The problem is another
Read the answers and old messages
what answers
^
Yeah but as said above use saveDefaultConfig
why dont i have image access
Verify
why you register commands before than config xd
What if I create a var plugin and instead of putting FileConfiguration config = this.getConfig(); in the OnEnable(), I put that after the start of the main class with FileConfiguration config = plugin.getConfig();
can someone help me with this question
i mean just do getConfig() in your onEnable lol
Which part do you need help with
saveDefaultConfig();
getConfig().addDefault("is-conclure-sus", true);
getConfig().option().copyDefaults(true);```or smth?
wym
trhere is only one tihing
wtf
What about it don't you understand?
how to code it
why using a field?
If you store it in a field you have to reassign it if you reload
I need to use the var config in the next lines
just call the getConfig() method or make a variable in your onEnable
You cant use plugins with api versions below 1.13 on your servers right (unless the servers are below 1.13 as well)?
you don;t need a var, just getConfig() each time
API versions below 1.13 don’t exist
My plugin compiled with a 1.12 api version
You know what, just send me the code
And servers below 1.13 don’t even check api version of plugins
Of course it’ll compile, it’s just a line of text in a text file
But it does nothing
Well apparently it found the dependency
Im talking about the pom.xml
DIfferent question, how can you make your plugin compatible with versions below 1.13
you passed a null to the constructor?
whats a differenece between hashset and hashmap
hashmap stores key value pairs
hashset is just a normal collection that stores stuff
a
please contact google for further questions ©️
hasj
How can you make your plugin compatible with versions below 1.13?
build it for versions below 1.13 and see if it works on 1.13+
use abstraction
xseries for enums
If i use versions below 1.13 i cant use it for a server thats above 1.13
reflections 🤣
You can
just make sure to break your reflections
otherwise people won't know that you use reflections
Just takes a bit of work
and if you use reflections, you always want people to know that you use reflections
otherwise, don't use reflections
I tried it it says incompatible api version
Or do i leave the version on 1.13 in the plugin yml
Correct
"i tried" like if we know what you tried :wheeze:
how can i make an entity follow a player? using remapped btw
Add a goal to the mob
add a follow entity goal or smth
^
See the thread
We helped a with this earlier
You should just save that to the pdc
where?
Idk how to link threads on mobile
there is a Player#getStatistic(Statistic.MINE_BLOCK, Material) too
now that am done with code cademy
Click the threads button
on how to learn?
yes
Youtube videos are usually quite bad
at first its pretty confusing
theyre bad
43 videos to be exact
i expected quality but i was like bruh what is this code
and you still don't know?
yeah me too
and apis
✨ pair programming ✨
Those are things you learn to figure out yourself
what
?paste
?help
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 names and nicknames of a member.
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.
how do i give a player a custom head
packets?
packwhat
No bad idea
I finally finished my wrappers for Goal (PathfinderGoal in spigot mappings) and PathNavigation (AbstractNavigation in spigot mappings) for 1.16.1 - 1.19.1 Damn, that was annoying lol
Did you write that blog post Alex?
hm?
(About heads)
oh no, I was busy with my path and goal wrappers
I'll write it this evening (its about 3pm here)
Ah ok
rightclick chest
package me.goldenheads.goldenheads.commands;
import com.google.common.collect.Multimap;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.SkullType;
//import org.bukkit.attribute.Attribute;
//import org.bukkit.attribute.AttributeModifier;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.entity.Player;
import org.bukkit.inventory.EquipmentSlot;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
//import org.bukkit.inventory.meta.tags.CustomItemTagContainer;
//import org.bukkit.persistence.PersistentDataContainer;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class GoldenHeadCommandGiver implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if(sender instanceof Player) {
Player player = (Player) sender;
ItemStack goldenhead = new ItemStack(Material.PLAYER_HEAD); //here
ItemMeta itemStackMeta = goldenhead.getItemMeta();
itemStackMeta.setDisplayName("&6Golden Head");
SkullMeta skullMeta = (SkullMeta) goldenhead.getItemMeta();
skullMeta.setOwningPlayer(Bukkit.getOfflinePlayer("BlindFrenetic"));
goldenhead.setItemMeta(skullMeta);
goldenhead.setItemMeta(itemStackMeta);
}
return true;
}
}
cannot find symbol is the error
which symbol
unless i did something sutpid
why do you place item meta two times?
idk
you set the skull meta then set back the old one
uh
You are using two Meta instead of using one. If your missing symbol is on PLAYER_HEAD you have a missing api version in your plugin.yml
wym
it shows you where is the missing symbol
Material.PLAYER_HEAD
what
add an api-version: 1.13 to your plugin.yml
still getting same error
What version of spigot are you using
1.8.8
Is it possible to save a ConfigurationSection to a file?
Save string path?
Saving the content of a ConfigurationSection
you can do for loop and do what you want with it
MAYBE HE COULD HAVE HELPED ME OUT BUT NO
ALL HE SAID IS "I've found out why it wont work"
Show your code then
yea but there already is a method in FileConfiguration which can save stuff to a file. However I dont see a way to create a FileConfiguration from a ConfigurationSection
all i want to do is for it to add "oil" every certain seconds in the "result" slot in a furnace
here
it caps at 1 (duh)
Get the item stack and add 1 to the amount
i would say if its empty, just set one oil there. if it is not empty, get the already existing oil and increment its amount by one.
how can i increment it by one tho?
getAmount + 1
ohhhhhhhhhhhhh
okey
if i use inv.getItem(int index) method
then do +1
it throws out an error
is there another method????
How to fix that
I would like to, but I don't know where it comes from
Core.java, line 71
no, do item.setAmount(item.getAmount() + 1)
thanks 👍
Hello
could someone help me out on my skript
ik im bad at coding
so what am i doing wrong here
command /gamble: trigger: if player has honeycomb named "&a&lcoin" chance of 10%: give player 10 honeycomb named "&a&lcoin" send "&a&lYou won!"
im getting a error on line 3
not the right place to ask. go to the skript discord
they will help a lot better there
I would like to modify the cobblestone generated by a cobblestone generator (Water + Lava)
By 50% chance a diamond block
20% chance an iron block
and 40% chance a netherite block
This is an example
How can make this?
is there a way to get the NMS class from a bukkit class? E.g. org.bukkit.entity.LivingEntity -> net.minecraft.world.entity.LivingEntity?
Is there a way to prevent players from switching an item to the other hand? Because I couldn't find an event for that
Not without casting to the craftbukkit implementation, the api doesn’t know anything about what NMS class it wraps
well I don't have any object
I only have the EntityType or sth like Class<Zombie> (bukkit zombie class)
but not any instance of the entity
if I'd had an instance, it'd be no problem at all
I don’t think you can get the NMS class from that, no
RIP
Might be an option through the entity type
Because the API intentionally doesn’t know about it
I wanna wrap the AvoidEntityGoal to make it usable without NMS
Nms has entity type registry
that sounds promising
The entity type should expose it's key
Bukkit one ^
Then you could try a lookup through that
Tho idk if the entity type actually hard links to the nms class
that might work
Or just includes a factory for the nms instance
Nothing in the bukkit api hard links to the NMS class
The api intentionally has no concept of NMS
hm I didnt find anything useful in NMS EntityType
I hoped maybe something like CraftMagicNumbers.toNmsEntityType existed lol
Man you're going to hate to hear that the whole concept of EntityType is fucked
I'd also be fine with a "mapping" between bukkit entity classes and NMS entity classes 😄
Bukkit's EntityType is returned as a literal in all Craft implementations of each entity, and the spawnEntity(EntityType) methods just have a massive if statement chain
There is no direct mapping between EntityType and NMS' EntityType
yeah I've seen that lol
The best you'll do is just pulling from an NMS registry the key of the EntityType, but if all you have is a Class<Entity>, you're not going to be able to do much with that
hm the weird thing is also that AvoidEntityGoal takes a Predicate<NMSLivingEntity> but seems to never use it
if it would at least use that, I wouldnt need to map any bukkit type or class to the NMS one
oh wait, it does use it, just not the field. it uses the constructor parameter to turn it into a TargetingConditions
then I can just use that
It's also protected. So if something extends it, it probably uses it directly
I'm not in my IDE though so I can't get a type hierarchy
yeah I'm basically just wrapping some NMS goals into my own interfaces. So I'll just try to turn the Predicate that uses NMS stuff into one that uses bukkit classes
e.g. this is a generic Goal that can be used without NMS. But I now also wanna do that for specific goals https://github.com/JEFF-Media-GbR/JeffLib/blob/master/spigot_1_19_R1/src/main/java/com/jeff_media/jefflib/internal/nms/v1_19_R1/ai/CustomGoalExecutor.java
I got it to work by just wrapping the Predicate<BukkitEntity> into a Predicate<NMSEntity> that just calls the other predicate using getBukkitEntity()
lol. that dude likes emeralds but hates swords
run mate
i think it does
it does not 😅
I just always pass LivingEntity as class and then use the predicate 🙂
that's way more flexible anyway
I want to make that every player get sent block data for example playerhead but they could walk thru it
If i make it air its just not capable of even send data
you can use FallingBlocks
Just wondering how to make block appear for every player
dis in ticks right?
but they are quite buggy and will always disappear after X minutes
Something like, every player can interact with it, then it disappear
oh yeah shit it only has generic link
But only for player that interacted with the block
If i just set type as air, it just dissapears, i want to make every player that has not interacted with it, still see the block and interact with it
Oh, would be better to just place armor stand with head as block?? ;D
You want it, si some players can see the block and some cannot?
If so, you'll have to introduce packets
Ik but for some reason i cannot send blockdata when the block is air
then how to make it only disappear for one player... idk
i want to make player albe to walk thru it
certain
anyone know how tall is the player in blocks?
not 1.8?
isn't it at least lower than 2?
cause there is a gap
when below a ceiling
jsut thought if someone knew it first, cause i would rather not dig through nms
right, typo, at most 2
checked the wiki, and yeah it's 1.8 blocks just standing
mh nice
thx! didn't know the the wiki has it, where exactly?
https://minecraft.fandom.com/wiki/Player here's the page i was looking at
it's in a weird spot below the player images
1.8 and 1.5 for stand and sneak
yep
yeah, needed some pinpoint accuracy
https://www.spigotmc.org/resources/conxeptworks-model-engine—ultimate-custom-entity-model-manager-1-14-1-19.79477/ something like this but better
too lazy to pay, also can't expand this, so better just make my own
"too lazy to pay" lol
what is this, chef simulator?
XD
does anyone know what the parameters mean in the DefaultRandomPos methods? 😄
would be very useful to know that lol
Do you use Mojang mappings?
yes
but the parameter names aren't included in the mappings
why it not work? mc 1.19.1
before 1.19.1 it worked correctly
all text dont work
oh one moment
sorry
I have SkullMeta, how to set it to the block?
its minecraft client text, how change it?
otherwise the unknow command option in the spigot yml config is now meaningless
clear papermc server and this item text
**unknow-command **text dont replaced
give me a sec
I have custom texture, how to set the skullmeta, i dont want to set OwningPlayer
does anybody know how to make entity follow player? using remapped
i dont know how to use goal path
i know!!!!
why dont replace message from spigot yml???
unknow-command parameter
any unregistered cmd need replaced message "unknow commannd"
there's a setBase64 method somewhere
https://hub.jeff-media.com/javadocs/jefflib/com/jeff_media/jefflib/SkullUtils.html#getBase64Texture(org.bukkit.inventory.meta.SkullMeta)
this gets the base64 from a sullmeta
https://hub.jeff-media.com/javadocs/jefflib/com/jeff_media/jefflib/SkullUtils.html#setBase64Texture(org.bukkit.block.Block,java.lang.String)
and this sets it to a block
@formal bear
declaration: package: com.jeff_media.jefflib, class: SkullUtils
Hey guys, simple question, is 1.19.1 still 1_19_R1 or is it a new version of spigot 1_19_R2?
still R1
thanks!
just use entity.getNavigation().walkTo(path)
or directly do
entity.getNavigation().walkTo(x, y, z, speed);
I dont understand it... How to call the getBase64Texture?
oh yeah
thats what I meant
i used walkTo because that's how I called it in my wrapper class lol
wdym? the parameters are obvious, aren't they?
bruh doesnt github ignore files that are in the gitignore file but are pushed to gh already?
its a config files which contains sensitive info and i want the file on gh to contain different data than the real one
git noob basically
hey guys, this is my plugin structure and when I build using maven, the server says it cant find plugin.yml
Does any1 know how i can convert an ItemStack to one of these stings?
how change this text? like a "this command not register"
open your Jar using something like Winrar and see if your plugin.yml is actually there
its not there
i think you might need to mark your resources root
bruh this in the .gitignore would point to the config.json file in the resources folder right?
how to do that
did you override the "canUse" method?
what's "speed" set to?
what entity? some entities are really slow
it's not the actual speed but a speed "modifier"
havent checked for husks but just for fun, set the speed modifier to 20 and see if anything happens
smh
also you gotta call moveTo periodically, otherwise it'll stop walking after some time. You should just save the entity's path in a field, and then in tick(), call walkTo(path) periodically
can i cast GameProfile to PlayerProfile?
hey hey i need help i just fucked up git, how can i 'ignore' new changes made to a file but the file is already pushed?
ehhhhhhhhhh im getting annoyed, theres really no easy way to place custom skull block
i dont understand
delete the file from repo
gameprofile and getproperties.put
uhh i still want to keep it, but it basically stores tokens and i dont want that on gh, i want it to contains some data i wrote afterwards
What do i need to return so i can place it as block 🙃
private SkullMeta getSkull(String url, GameProfile profile, ItemStack itemStack) {
if (!url.isEmpty()) {
SkullMeta headMeta = (SkullMeta) itemStack.getItemMeta();
profile.getProperties().put("textures", new Property("textures", url));
try {
assert headMeta != null;
Field profileField = headMeta.getClass().getDeclaredField("profile");
profileField.setAccessible(true);
profileField.set(headMeta, profile);
} catch (NoSuchFieldException | IllegalAccessException e) {
e.printStackTrace();
}
return headMeta;
} else {
return null;
}
}
Does it really matter?
print out every start, stop, canUse result, and tick
see if it actually keeps running
I know how to make get it as ItemStack
I just dont know how to set the meta of skull to the block
canUse should also get printed every tick though?
could anyone help me with a little bit of packet problems?
this is my code https://paste.md-5.net/oyoxokiriz.cs. my problem is that when i try to summon a dropped item, the item never spawns yet i dont get an error in console, but when i change the entity to something like an armorstand, it works perfectly fine
what is profile public key?
its set when you place the skull
or do you mean you want to change teh texture of an already placed skull?
how do i create an npc in 1.19? beacuse it needs something called profile public key
pass null
yeps
remember me
dont understand why i cant use > on a integer
put parenthessees around the boolean
right now its reading it as a string
the way string concatanation works is afaik is it autoreads ints as strings
may be wrong but thats what I recall
im new to java and im using knowledge from my other coding langs to this thats why lol
don't use integer btw just use int
java has autounboxing and boxing for primitive types
Are you a V dev
thought they were the same
hey magma guy
<>^v are the only characters a programming language should accept
hey
I'll call this vector based programming
Integer is an object that wraps the int value and provides extra functionality
if it provides extra functionality then why dont i use it instead lol
because its uneeded especially in your scenario
its always best to use the primitives over wrapper objects if you can help it
to translate a number to a string you can do String.valueOf(number)
Integer is also annoying because it can be null and is generally annoying to cast
That too primitives can not be null
bad for math
null pointer error in my math problem 💀
yo yaw is from -180 to 180 || 0 to 360 ?
how much is zero divided by null?
does that throw an error or does java be like bruh wtf you doing idiot and auto make it 0
safety is for dorks
I like my code to be unsafe thats why I quit rust permanently I want to make everything null
Ok use c++ then
I hope you understand how well I am dancing this L dance
lets go for C
magma guy you know privacy isn't dead right lol
but rust has segmentation errors when doing unsafe casts kekw
like (const*) 12345 or smth
did you learn that by snooping my account?
interesting
bruh's clearly never faked his death deleted all social media reqiested all data collected about yourself be deleted. left your home and everything you own to go live in the woods in the middle of nowhere
hm
I did half of that
I am literally in the process of doing the other half rn
moving to canada
let x: *const u8 = std::ptr::null();
println!("{}", unsafe { *x });
nullptr lmfao
A browser interface to the Rust compiler to experiment with the language
@quaint mantle you can check dm with me please?
Thanks for giving me 20 seconds to answer
ItemMeta#addAttribute or smth?
Yeah
or itemflags
one second
who can I get an text from anvil rename?
what
if you rename an item in an anvil how can I get that text
he means how he can get the input out uf an anvil inventory
Oh
fucking gold digger
do someone knows why this happens? The entity "jumps" if it will pass the slab
here the speed is about 10
nice reaction time lmao
that's the builtin MoveToBlockGoal lol
Does anyone know how exactly ItemsAdder is doing the emotes?
aren't those just custom fonts for unused characters?
No I mean actual emotes, like a dancing player model
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
nothing just a joke
anyone?
Does anyone know why i keep getting this exception if I try to reload my plugin using Plugman?
https://paste.md-5.net/ojujojitut.bash
Caused by: java.util.zip.ZipException: ZipFile invalid LOC header (bad signature)
at java.util.zip.ZipFile$ZipFileInputStream.initDataOffset(ZipFile.java:920) ~[?:?]
at java.util.zip.ZipFile$ZipFileInputStream.read(ZipFile.java:931) ~[?:?]
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:448) ~[?:?]
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158) ~[?:?]
at java.io.FilterInputStream.read(FilterInputStream.java:132) ~[?:?]
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270) ~[?:?]
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313) ~[?:?]
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188) ~[?:?]
at java.io.InputStreamReader.read(InputStreamReader.java:177) ~[?:?]
at java.io.Reader.read(Reader.java:250) ~[?:?]
at java.util.Properties$LineReader.readLine(Properties.java:504) ~[?:?]
at java.util.Properties.load0(Properties.java:419) ~[?:?]
at java.util.Properties.load(Properties.java:382) ~[?:?]
at java.util.PropertyResourceBundle.<init>(PropertyResourceBundle.java:200) ~[?:?]
at java.util.PropertyResourceBundle.<init>(PropertyResourceBundle.java:177) ~[?:?]
at java.util.ResourceBundle$Control.newBundle0(ResourceBundle.java:3245) ~[?:?]
at java.util.ResourceBundle$Control.newBundle(ResourceBundle.java:3151) ~[?:?]
at java.util.ResourceBundle.loadBundle(ResourceBundle.java:1984) ~[?:?]
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1770) ~[?:?]
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1722) ~[?:?]
at java.util.ResourceBundle.findBundle(ResourceBundle.java:1722) ~[?:?]
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1656) ~[?:?]
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1586) ~[?:?]
at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1549) ~[?:?]
at java.util.ResourceBundle.getBundle(ResourceBundle.java:858) ~[?:?]
at org.apache.commons.dbcp2.Utils.<clinit>(Utils.java:38) ~[API-1.0.2.jar:?]
- do not use plugman
any solution?
fatal: repository '../Bukkit' does not exist
./applyPatches.sh: 16: cd: can't cd to /home/spigot/Spigot-API
Resetting Spigot-API to Bukkit...
fatal: ambiguous argument 'origin/spigot': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Applying patches to Spigot-API...
fatal: could not open '../Bukkit-Patches/*.patch' for reading: No such file or directory
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh```
What event is called when Water and Lava come together to make obsidian/cobblestone?
1.8.9
none, BlockFormEvent for cobble and obsidian is broken in 1.8.9
use a newer version
Is there any way to prevent this happening on 1.8.9?
Can i make this more efficient ?
public void promoteTeamMember(UUID member) {
if(isTeamLeader(member)) throw new IllegalStateException("Cannot promote the team leader, leader is the highest status");
if(!(teamRegistry.getTeam(member) == this)) throw new IllegalStateException("this player was not in the team that they tried to get promoted in");
if (getTeamRole(member) == TeamRole.values()[2]) {
memberList.put(member, TeamRole.values()[1]);
}
if (getTeamRole(member) == TeamRole.values()[1]) {
Bukkit.getLogger().info("Only one player can be leader");
}
}```
```enum
package me.r4wpanda.hold;
public enum TeamRole {
LEADER,
CO_LEADER,
MEMBER
}```
Just the top part
why aren't you using the enum?
getTeamRole(member) == TeamRole.MEMBER
is there a way to set a player's vision like an enderman's?
do not throw exceptions, rather return a boolean or smth
da fuq
i am using enum?
TeamRole.values()[0] -> TeamRole.LEADER
Someone knows how to simplify this code
yes, but why so complicated o.O
Well what i meant was is there a way to simplify the code?
Btw that isn't the whole class
That's just what i need simplified, if possible
switch
looks like craftbukkit code lol
true lol
I am trying to make it so a player is banned for a set amount of time. The .banPlayer() function can do this with the expiration date feature. I was wondering if there was a function that could take an input of time and add it to the current time. Ie. I input 20 mins and it returns the time it will be in 20 mins. I might just be being dumb
System.currentTimeMills + your time in milliseconds
/ban fourteen bad 18263637 smh
config framework which supports what?
But there is no way to put the class in a variable and then make the constructor with the variable of this one? instead of putting all the parameters every time
so this?
e.getPlayer().banPlayer("You died.", new Date(System.currentTimeMillis() + 120000l));
yes
make a variable for the bank and the owner
updating with comments and shit
Add "You died you noob get better lol lmao lmfao ez noob get rekt"
help pls
is using static for logger reasonable?
Yes
You can make custom ones using pdc
Whats that? Could you link me it please
?pdc
so in vanilla minecraft when you set a world border to say, size 800
the nether's world border will automatically be set to 100
and idk how the end does it
is it possible to replicate this in spigot, or do I have to loop through each world and manually do it?
i mean, just loop through all the words and check the type. it’s not that hard
?paste
Why is this not working https://paste.md-5.net/opoyatosiz.cs
Here are the console errors: https://paste.md-5.net/azucogazir.sql
yeah but
just wondering if theres a built in method
out of curiosity
where can i ask for plugin devs again?
or find them
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
?notworking*
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
Why is this not working? Im trying to get a string out of an anvil rename but nothing works. Here is my code https://paste.md-5.net/opoyatosiz.cs
Here are the console errors: https://paste.md-5.net/azucogazir.sql
Please help that would be so nice
} else if(event.getCurrentItem().getItemMeta().getDisplayName().equalsIgnoreCase("§aWelt Erstellen")) {
looks like this is where the npe is happening, the item you clicked probably doesnt have itemmeta
Caused by: java.lang.NullPointerException
at buildserver.main.listeners.inventoryListener.onInvClick(inventoryListener.java:60) ~[?:?]
Those are the easiest to fix -.-
heeelp 😭
any sites that would be recommended to start learning about coding spigot plugins
or videos
do you know Java
yes i am almost finished on codecademy
is there an event for when a player travels through a portal
xd
?wiki Has a lot of good resources
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
https://www.spigotmc.org/wiki/spigot-plugin-development/ good place to start
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ok let me finish codecademy
if your doing code cademy one run through isnt to helpful for the basics
run through it a few times to cement the knowledge
uh
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
Inside the loop, create a condition that checks if i is not divisible by 5. what does divisible mean
divide
you dont know how to divide or you dont know how to implement division in Java
how to implement division
the entire course
oh
or finish that one, and move down the list on learnjava
wym
hi. I want to write my own movement system using custom entities. Basically, I just need to check the block collision. How can I do that?
Current code java @Override public void move(EnumMoveType enummovetype, Vec3D vec3d) { IBlockData data = aU(); if (data.isAir()) setPosition(locX() + vec3d.b, locY() + vec3d.c, locZ() + vec3d.d); else setPosition(locX() + vec3d.b, locY(), locZ() + vec3d.d); }
there's a collide(vec3d) method
Check if a is divisible by b: a % b == 0
% is the modulo operator, and it defines the leftover of a division. So 5 % 2 would be 1, since 2 fits into 5 twice and 1 is left over
i already did it but thanks for the help
why does this still make the player pick up the enderpearl
PlayerAttemptPickupItemEvent
because that if event isnt firing more than likely
check the material type
dont use equals on itemstacks for checks
no
So then debug log, see if that fires
that has nothing to do with that
i mean it’s the line you’re getting the exception on ¯_(ツ)_/¯
Try using the PlayerPickupItemEvent instead of the attempt one
wait but when my homie drops his pearl he can pick it up
ok so it sometimes works and sometimes doesnt
when enderman drops item is it an item or an itemstack?
anyone?
this is your answerr mrrioes
he told you the line the exceptions happening on
Its either item meta is null or item name is null when using .equals
Also
Why InventoryClickEvent?
1.8?
declaration: package: org.bukkit.event.inventory, class: PrepareAnvilEvent
didnt work btw
might be a paper thing
just decompile the move(...) method
and see how it worky
literally what I did
I decompiled it, checked every part for collisions and banged my head against the wall for 3 hours straight
hello how can i do a code that automatic builds a glass cube without nothing inside?
Is it possible to create a custom packet listener
yes, with ProtocolLib
Well youd need an algorithm that creates a sphere
You can likely steal fawes, or just use fawe api
guys, anyone here knows how thermos work ?
im trying to run a plugin that utilizes nms but aparently thermos does not have nms on his libraries
Yeah
From what I've read custompayload is my best guess
it's me again!! how would I load NMS stuff? (specifically net.minecraft.server.v1_7_R4.ItemStack, NBTTagCompound, CraftItemStack)
?paste
i wrote one
it have some bugs
it is good enough for you to have the idea
the bugs are with /reload though
flawless!
1.17.1
Hey, Im trying to add and world with the world name getting from chat https://paste.md-5.net/ewufepasuh.cs https://paste.md-5.net/azamodeyal.pl
your maven is working?
wdym?
nvm read it wrong try adding bukkit api
I got it working but now I would like to edit the collision thing
I would like to it ignore the slabs
how can I create custom toasts?
this thing
one plugin already does it, but idk how
car stuff
i saw a time ago that there is a packet for that
do you remember just a part of the name?
we were talking about this in a thread, but how would I install org.bukkit:bukkit? I ran buildtools many times before
so I have no idea why it doesnt exist
Why do you need that
see if it is in your ~/.m2/repositories
it isn't, just looked
custom nbt tag
then it is not running
try running it again
and if any error happens
paste it here
You use the Spigot artifact for NMS
just {coolThing:"coolValue"} not really
do you remember just a part of the name?
bukkit no longer gets installed automatically with buildtools. Instead use spigot. There is no reason to use bukkit and is only used by buildtools to build spigot.
nop
okay, how would I add a custom NBT tag?
.
anyone?
you would need to mess with NMS for this, and second the server won't read custom nbt tags automatically either I don't think
I basically just want this
just so the plugin can tell if the item's special
im using 1.8
yep this would be the best way for them to go about it
Yeah I know the pdc wasn't for you
ok
how did I not know that existed damn
gonna check out if it works thx
well how should I then go about doing it if I get the name in asyncchatevent
just because you get the name from an asyncevent doesn't mean your entire method after has to be async
yeah but how do I execute it then
You can use the scheduler to jump back to the main thread
^
?scheduling
?pdc
@rain mason
already working w it
pdc good
From older versions PDC is basically the advancement of metadata that persists
my suffering was done many moons and suns ago
lol
wtf is codecademy
its a site that is suppose to help teach you java and other things
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
